Skip to contentSkip to conversation

nmclan_cs: dereferencing skb after netif_rx()

PATCH New Florin Malita 1 participant 1 message May 30, 2006 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nmclan_cs: dereferencing skb after netif_rx()

The skb may be gone after netif_rx(), we can't use 'skb->len' to update the stats. 'pkt_len' should work instead.

Coverity CID: 911.

---

drivers/net/pcmcia/nmclan_cs.c +1 -1
index 4260c21..a8f6bfc 100644
@@ -1204,7 +1204,7 @@ static int mace_rx(struct net_device *de
 
 	dev->last_rx = jiffies;
 	lp->linux_stats.rx_packets++;
-	lp->linux_stats.rx_bytes += skb->len;
+	lp->linux_stats.rx_bytes += pkt_len;
 	outb(0xFF, ioaddr + AM2150_RCV_NEXT); /* skip to next frame */
 	continue;
       } else {