Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gianfar: Fix packet drop when out of memory

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>

authored by

Andy Fleming and committed by
David S. Miller
8882d9a6 a693722a

+1 -2
+1 -2
drivers/net/gianfar.c
··· 1732 1732 1733 1733 if (unlikely(!newskb)) 1734 1734 newskb = skb; 1735 - 1736 - if (skb) 1735 + else if (skb) 1737 1736 dev_kfree_skb_any(skb); 1738 1737 } else { 1739 1738 /* Increment the number of packets */