summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWang Chen <wangchen@cn.fujitsu.com>2008-05-20 17:13:52 +0800
committerJeff Garzik <jgarzik@redhat.com>2008-05-22 14:02:46 -0400
commitf7f312a0c7e7a1947cf193e0e94a257ad7742cb2 (patch)
treec142f82b0177595e82aab7a802e2495afed4fcdf
parent56cfe5d028687468f76e8b613c63ca41f209982d (diff)
downloadlinux-3.10-f7f312a0c7e7a1947cf193e0e94a257ad7742cb2.tar.gz
linux-3.10-f7f312a0c7e7a1947cf193e0e94a257ad7742cb2.tar.bz2
linux-3.10-f7f312a0c7e7a1947cf193e0e94a257ad7742cb2.zip
3C509: rx_bytes should not be increased when alloc_skb failed
If alloc_skb failed, the recieved packet will be dropped. Do not increase rx_bytes for dropped packet. Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r--drivers/net/3c509.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c
index e6c545fe5f5..fe6d84105e5 100644
--- a/drivers/net/3c509.c
+++ b/drivers/net/3c509.c
@@ -1063,7 +1063,6 @@ el3_rx(struct net_device *dev)
struct sk_buff *skb;
skb = dev_alloc_skb(pkt_len+5);
- dev->stats.rx_bytes += pkt_len;
if (el3_debug > 4)
printk("Receiving packet size %d status %4.4x.\n",
pkt_len, rx_status);
@@ -1078,6 +1077,7 @@ el3_rx(struct net_device *dev)
skb->protocol = eth_type_trans(skb,dev);
netif_rx(skb);
dev->last_rx = jiffies;
+ dev->stats.rx_bytes += pkt_len;
dev->stats.rx_packets++;
continue;
}