diff options
author | Vishal Thanki <vishalthanki@gmail.com> | 2016-03-19 13:41:01 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2016-04-06 21:40:43 +0300 |
commit | 8b4c0009313f3d42e2540e3e1f776097dd0db73d (patch) | |
tree | 72c8ce2c20c51cb659cb4fb44b4ca9640313692c /drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | |
parent | e32993eb3aed598790ba0c581796c357898bd8f0 (diff) | |
download | linux-8b4c0009313f3d42e2540e3e1f776097dd0db73d.tar.xz |
rt2x00usb: Use usb anchor to manage URB
With current driver, it is observed that a URB is not
completed while the USB disconnect is initiated. Due to
that, the URB completion handler is trying to access
the resource which was freed as a part of USB disconnect.
Managing the URBs with anchor will make sure that all
the URBs are handled gracefully before device gets
disconnected.
Signed-off-by: Vishal Thanki <vishalthanki@gmail.com>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ralink/rt2x00/rt2x00dev.c')
-rw-r--r-- | drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c index 5639ed816813..b2f7c586045d 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c @@ -1422,11 +1422,14 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev) cancel_work_sync(&rt2x00dev->intf_work); cancel_delayed_work_sync(&rt2x00dev->autowakeup_work); cancel_work_sync(&rt2x00dev->sleep_work); +#ifdef CONFIG_RT2X00_LIB_USB if (rt2x00_is_usb(rt2x00dev)) { + usb_kill_anchored_urbs(rt2x00dev->anchor); hrtimer_cancel(&rt2x00dev->txstatus_timer); cancel_work_sync(&rt2x00dev->rxdone_work); cancel_work_sync(&rt2x00dev->txdone_work); } +#endif if (rt2x00dev->workqueue) destroy_workqueue(rt2x00dev->workqueue); |