projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e4d1aa4
)
net: fix memory leak on oom with zerocopy
author
Michael S. Tsirkin
<mst@redhat.com>
Sat, 15 Sep 2012 22:44:16 +0000
(22:44 +0000)
committer
David S. Miller
<davem@davemloft.net>
Tue, 18 Sep 2012 20:24:00 +0000
(16:24 -0400)
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@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c
patch
|
blob
|
blame
|
history
diff --git
a/net/core/dev.c
b/net/core/dev.c
index d7fe32c946c1a472b46f086929badaea6900d432..ac7609d85187c985d4a7d4dbb75a5b0c61c35024 100644
(file)
--- a/
net/core/dev.c
+++ b/
net/core/dev.c
@@
-3322,7
+3322,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 {