[PATCH] nmclan_cs: dereferencing skb after netif_rx()

From: Florin Malita <fmalita@gmail.com>

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 <fmalita@gmail.com>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Florin Malita and committed by
Linus Torvalds
6f258910 50ff06d1

+1 -1
+1 -1
drivers/net/pcmcia/nmclan_cs.c
··· 1204 1204 1205 1205 dev->last_rx = jiffies; 1206 1206 lp->linux_stats.rx_packets++; 1207 - lp->linux_stats.rx_bytes += skb->len; 1207 + lp->linux_stats.rx_bytes += pkt_len; 1208 1208 outb(0xFF, ioaddr + AM2150_RCV_NEXT); /* skip to next frame */ 1209 1209 continue; 1210 1210 } else {