From: Florin Malita Date: Sun, 4 Jun 2006 09:51:26 +0000 (-0700) Subject: [PATCH] nmclan_cs: dereferencing skb after netif_rx() X-Git-Tag: v2.6.17-rc6~43 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6f258910733a8dbde368acc2ede4b8184ff0e09a;p=platform%2Fkernel%2Flinux-exynos.git [PATCH] nmclan_cs: dereferencing skb after netif_rx() From: Florin Malita 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. Signed-off-by: Florin Malita Cc: Dominik Brodowski Acked-by: Jeff Garzik Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c index 4260c21..a8f6bfc 100644 --- a/drivers/net/pcmcia/nmclan_cs.c +++ b/drivers/net/pcmcia/nmclan_cs.c @@ -1204,7 +1204,7 @@ static int mace_rx(struct net_device *dev, unsigned char RxCnt) 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 {