dect
/
linux-2.6
Archived
13
0
Fork 0

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>
This commit is contained in:
Wang Chen 2008-05-20 17:13:52 +08:00 committed by Jeff Garzik
parent 56cfe5d028
commit f7f312a0c7
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}