[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120916084416.GA22936@redhat.com>
Date: Sun, 16 Sep 2012 11:44:16 +0300
From: "Michael S. Tsirkin" <mst@...hat.com>
To: unlisted-recipients:; (no To-header on input)
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Ben Hutchings <bhutchings@...arflare.com>,
Michał Mirosław <mirq-linux@...e.qmqm.pl>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] 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 <mst@...hat.com>
---
Fixes a memory leak so 3.6 material?
net/core/dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 8398836..899f827 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -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 {
--
MST
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists