Skip to content

Commit

Permalink
3C509: rx_bytes should not be increased when alloc_skb failed
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wang Chen authored and Jeff Garzik committed May 22, 2008
1 parent 56cfe5d commit f7f312a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/3c509.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down

0 comments on commit f7f312a

Please sign in to comment.