Record stat's before dispatch, and generally don't try to access NULL pointers
authormentor <mentor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Thu, 22 May 2008 16:09:19 +0000 (16:09 +0000)
committermentor <mentor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Thu, 22 May 2008 16:09:19 +0000 (16:09 +0000)
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3674 0192ed92-7a03-0410-a25b-9323aeb14dbd

net80211/ieee80211_input.c

index ddef498b274df9138e68374ab34129b09ed92584..270e89e50981f957f38f09f7ae64220b15d24139 100644 (file)
@@ -1171,6 +1171,10 @@ ieee80211_deliver_data(struct ieee80211_node *ni, struct sk_buff *skb)
        }
 
        if (skb != NULL) {
+               vap->iv_devstats.rx_packets++;
+               vap->iv_devstats.rx_bytes += skb->len;
+               dev->last_rx = jiffies;
+
                skb->dev = dev;
 #ifdef USE_HEADERLEN_RESV
                skb->protocol = ath_eth_type_trans(skb, dev);
@@ -1191,10 +1195,6 @@ ieee80211_deliver_data(struct ieee80211_node *ni, struct sk_buff *skb)
                        vap->iv_devstats.rx_dropped++;
                }
                skb = NULL; /* SKB is no longer ours */
-
-               vap->iv_devstats.rx_packets++;
-               vap->iv_devstats.rx_bytes += skb->len;
-               dev->last_rx = jiffies;
        }
 }