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@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e4d1aa40e3
commit
0e698bf662
|
@ -3322,7 +3322,7 @@ ncls:
|
||||||
|
|
||||||
if (pt_prev) {
|
if (pt_prev) {
|
||||||
if (unlikely(skb_orphan_frags(skb, GFP_ATOMIC)))
|
if (unlikely(skb_orphan_frags(skb, GFP_ATOMIC)))
|
||||||
ret = -ENOMEM;
|
goto drop;
|
||||||
else
|
else
|
||||||
ret = pt_prev->func(skb, skb->dev, pt_prev, orig_dev);
|
ret = pt_prev->func(skb, skb->dev, pt_prev, orig_dev);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue