rt2x00: Don't kill guardian_urb when it wasn't created
authorIvo van Doorn <IvDoorn@gmail.com>
Tue, 3 Jun 2008 18:29:50 +0000 (20:29 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 13 Jun 2008 20:14:46 +0000 (16:14 -0400)
This fixes a "BUG: unable to handle kernel paging request"
bug in rt73usb which was caused by killing the guardian_urb
while it had never been allocated for rt73usb.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2x00usb.c

index 5a331674dcb2384c036f77b08aa79f93b819946a..e5ceae805b579805909f72fe7a98f43247775f9e 100644 (file)
@@ -362,6 +362,12 @@ void rt2x00usb_disable_radio(struct rt2x00_dev *rt2x00dev)
                }
        }
 
+       /*
+        * Kill guardian urb (if required by driver).
+        */
+       if (!test_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags))
+               return;
+
        for (i = 0; i < rt2x00dev->bcn->limit; i++) {
                priv_bcn = rt2x00dev->bcn->entries[i].priv_data;
                usb_kill_urb(priv_bcn->urb);