]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
rt2x00: fix cancelling uninitialized work
authorStanislaw Gruszka <sgruszka@redhat.com>
Mon, 4 Apr 2011 11:50:32 +0000 (13:50 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 14 Apr 2011 20:02:25 +0000 (13:02 -0700)
commit 37f4ee0b6b39640828dac5937a482c20e8ac794f upstream.

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

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/wireless/rt2x00/rt2x00dev.c

index 9597a03242cceb7bbed7fd8b0d847741c2450097..2b77a291aa970f5cf6e3f4e27450d4e80eeaf87a 100644 (file)
@@ -1031,8 +1031,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);
+       }
 
        /*
         * Free the tx status fifo.