Skip to content

Commit

Permalink
gianfar: Fix packet drop when out of memory
Browse files Browse the repository at this point in the history
The patch which fixed gianfar so it drops packets when it runs out
of memory left in the code which frees the skb when it drops packets.
Change the code so that we only free the skb if the new skb was successfully
created.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Andy Fleming authored and David S. Miller committed Dec 18, 2008
1 parent a693722 commit 8882d9a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/gianfar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1732,8 +1732,7 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit)

if (unlikely(!newskb))
newskb = skb;

if (skb)
else if (skb)
dev_kfree_skb_any(skb);
} else {
/* Increment the number of packets */
Expand Down

0 comments on commit 8882d9a

Please sign in to comment.