From: Andy Fleming Date: Thu, 18 Dec 2008 00:50:22 +0000 (-0800) Subject: gianfar: Fix packet drop when out of memory X-Git-Tag: 2.1b_release~14975^2~136 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8882d9a60028a9937e9c5652cfb80d4399ce5242;p=platform%2Fkernel%2Fkernel-mfld-blackbay.git 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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 3e611a6..a6efabc 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c @@ -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 */