Skip to contentSkip to conversation

rt2x00: fix cancelling uninitialized work

PATCH In review Stanislaw Gruszka 2 participants 2 messages Apr 4, 2011 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rt2x00: fix cancelling uninitialized work

{rx,tx}done_work's are only initialized for usb devices.

---
 drivers/net/wireless/rt2x00/rt2x00dev.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/rt2x00/rt2x00dev.c +4 -2
index 9de9dbe..84eb6ad 100644
@@ -1062,8 +1062,10 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev)
 	 * Stop all work.
 	 */
 	cancel_work_sync(&rt2x00dev->intf_work);
-	cancel_work_sync(&rt2x00dev->rxdone_work);
-	cancel_work_sync(&rt2x00dev->txdone_work);
+	if (rt2x00_is_usb(rt2x00dev)) {
+		cancel_work_sync(&rt2x00dev->rxdone_work);
+		cancel_work_sync(&rt2x00dev->txdone_work);
+	}
 	destroy_workqueue(rt2x00dev->workqueue);
 
 	/*
Signature · 1 line
1.7.1
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Stanislaw Gruszka

{rx,tx}done_work's are only initialized for usb devices.

Quoted 25 lines

---
 drivers/net/wireless/rt2x00/rt2x00dev.c |    6 ++++--

 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/rt2x00/rt2x00dev.c +4 -3
index 9de9dbe..84eb6ad 100644
@@ -1062,8 +1062,10 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev)
         * Stop all work.
         */
        cancel_work_sync(&rt2x00dev->intf_work);
-       cancel_work_sync(&rt2x00dev->rxdone_work);
-       cancel_work_sync(&rt2x00dev->txdone_work);
+       if (rt2x00_is_usb(rt2x00dev)) {
+               cancel_work_sync(&rt2x00dev->rxdone_work);
+               cancel_work_sync(&rt2x00dev->txdone_work);
+       }
        destroy_workqueue(rt2x00dev->workqueue);
 
        /*
--

1.7.1