ath9k_htc: Fix RX URB reference count
authorSujith <Sujith.Manoharan@atheros.com>
Tue, 6 Apr 2010 09:58:13 +0000 (15:28 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 8 Apr 2010 19:24:09 +0000 (15:24 -0400)
RX URBs are automatically freed when the reference
count drops to zero - this currently doesn't happen when
usb_kill_anchored_urbs() is called during unload.

Fix this by dropping the reference count by one during
initial submission.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/hif_usb.c

index 8838cdfcc49779212fea5ab0dfd42959a1465d24..4528df4a5bdc7863ac64491b8f19e55fc688f802 100644 (file)
@@ -652,6 +652,12 @@ static int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev)
                        usb_unanchor_urb(urb);
                        goto err_submit;
                }
+
+               /*
+                * Drop reference count.
+                * This ensures that the URB is freed when killing them.
+                */
+               usb_free_urb(urb);
        }
 
        return 0;