Please note: This project is no longer active. The website is kept online for historic purposes only.
If you´re looking for a Linux driver for your Atheros WLAN device, you should continue here .

Ticket #1069: node_saveq_drain_crash.fix

File node_saveq_drain_crash.fix, 0.8 kB (added by rozteck@interia.pl, 13 years ago)

The following patch fixes the crash

Line 
1 diff -ur madwifi-svn-r1860-mark/net80211/ieee80211_power.c madwifi-svn-r1860/net80211/ieee80211_power.c
2 --- madwifi-svn-r1860-mark/net80211/ieee80211_power.c   2006-09-20 10:45:13.000000000 +0200
3 +++ madwifi-svn-r1860/net80211/ieee80211_power.c        2007-01-07 17:17:37.000000000 +0100
4 @@ -110,13 +110,20 @@
5  ieee80211_node_saveq_drain(struct ieee80211_node *ni)
6  {
7         struct sk_buff *skb;
8 -       int qlen;
9 -
10 +       int qlen = 0;
11 +       
12 +       if (ni == NULL) {
13 +               printk("ieee80211_node_saveq_drain: ni is null!");
14 +               return qlen;
15 +       }
16 +       
17         IEEE80211_NODE_SAVEQ_LOCK(ni);
18         qlen = skb_queue_len(&ni->ni_savedq);
19         while ((skb = __skb_dequeue(&ni->ni_savedq)) != NULL) {
20 -               ieee80211_free_node(ni);
21 -               dev_kfree_skb_any(skb);
22 +               if (ni != NULL)
23 +                       ieee80211_free_node(ni);
24 +               if (skb != NULL)
25 +                       dev_kfree_skb_any(skb);
26         }
27         IEEE80211_NODE_SAVEQ_UNLOCK(ni);
28