]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ath9k_htc: Fix module unloading issue
authorSujith <Sujith.Manoharan@atheros.com>
Tue, 6 Apr 2010 09:58:15 +0000 (15:28 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 8 Apr 2010 19:24:10 +0000 (15:24 -0400)
The maximum number of packets in a single buffer in
stream mode is 10. The driver currently uses 8 - which
caused stack corruption, in the absence of any kind
of OOB checking.

Fixing this to the correct value of 10 fixes the module
unload issue.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Tested-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/hif_usb.c
drivers/net/wireless/ath/ath9k/hif_usb.h

index 4528df4a5bdc7863ac64491b8f19e55fc688f802..69bef1de71ae2ecd09358bf6a0f749f4715cceec 100644 (file)
@@ -324,7 +324,7 @@ static struct ath9k_htc_hif hif_usb = {
 static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev,
                                    struct sk_buff *skb)
 {
-       struct sk_buff *nskb, *skb_pool[8];
+       struct sk_buff *nskb, *skb_pool[MAX_PKT_NUM_IN_TRANSFER];
        int index = 0, i = 0, chk_idx, len = skb->len;
        int rx_remain_len = 0, rx_pkt_len = 0;
        u16 pkt_len, pkt_tag, pool_index = 0;
index ed9708cd4aa0ca8357ed50218a7df642e8831d95..179cea46a8e793c150478093ac1aede853871453 100644 (file)
@@ -34,6 +34,7 @@
 
 #define MAX_RX_URB_NUM  8
 #define MAX_RX_BUF_SIZE 16384
+#define MAX_PKT_NUM_IN_TRANSFER 10
 
 #define MAX_REG_OUT_URB_NUM  1
 #define MAX_REG_OUT_BUF_NUM  8