Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 2/5] ath9k_htc: Fix RX URB reference count
@ 2010-04-06 10:00 Sujith
  0 siblings, 0 replies; only message in thread
From: Sujith @ 2010-04-06 10:00 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless

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>
---
 drivers/net/wireless/ath/ath9k/hif_usb.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index 8838cdf..4528df4 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -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;
-- 
1.7.0.3


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-04-06  9:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-06 10:00 [PATCH 2/5] ath9k_htc: Fix RX URB reference count Sujith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox