Message ID | 1229550175-15600-1-git-send-email-afleming@freescale.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Andy Fleming <afleming@freescale.com> Date: Wed, 17 Dec 2008 15:42:51 -0600 > 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> Applied. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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 */
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> --- drivers/net/gianfar.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)