net: fix memory leak on oom with zerocopy
Subsystems (2)
PATCH 1/1 net: fix memory leak on oom with zerocopy
If orphan flags fails, we don't free the skb
on receive, which leaks the skb memory.
Return value was also wrong: netif_receive_skb
is supposed to return NET_RX_DROP, not ENOMEM.
Signed-off-by Michael S. Tsirkin <[email protected]>
---
Fixes a memory leak so 3.6 material?
net/core/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/dev.c +1 -1
@@ -3321,7 +3321,7 @@ ncls:if (pt_prev) {if (unlikely (skb_orphan_frags (skb,GFP_ATOMIC ))) - ret = -ENOMEM ; + goto drop;else ret = pt_prev->func (skb, skb->dev, pt_prev, orig_dev); }else {
Signature · 1 line
MST
From: "Michael S. Tsirkin" <[email protected]>
Date: Sun, 16 Sep 2012 11:44:16 +0300
Quoted 7 lines
If orphan flags fails, we don't free the skb
on receive, which leaks the skb memory.Return value was also wrong:
netif_receive_skb
is supposed to returnNET_RX_DROP, not ENOMEM.Signed-off-by Michael S. Tsirkin <[email protected]>
Applied, thanks Michael.