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.diff

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

This patch adds some NULL pointer checking in ieee80211_node_saveq_drain function preventing from crash. Signed-off-by: Tomasz Rostanski <rozteck@interia.pl>

  • madwifi-svn-r1860/net80211/ieee80211_power.c

    old new  
    110110ieee80211_node_saveq_drain(struct ieee80211_node *ni) 
    111111{ 
    112112        struct sk_buff *skb; 
    113         int qlen; 
    114  
     113        int qlen = 0; 
     114         
     115        if (ni == NULL) { 
     116                printk("ieee80211_node_saveq_drain: ni is null!"); 
     117                return qlen; 
     118        } 
     119         
    115120        IEEE80211_NODE_SAVEQ_LOCK(ni); 
    116121        qlen = skb_queue_len(&ni->ni_savedq); 
    117122        while ((skb = __skb_dequeue(&ni->ni_savedq)) != NULL) { 
    118                 ieee80211_free_node(ni); 
    119                 dev_kfree_skb_any(skb); 
     123                if (ni != NULL) 
     124                        ieee80211_free_node(ni); 
     125                if (skb != NULL) 
     126                        dev_kfree_skb_any(skb); 
    120127        } 
    121128        IEEE80211_NODE_SAVEQ_UNLOCK(ni); 
    122129