mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-11 15:40:50 +00:00
virtio-net: fix pages leaking when building skb in big mode
We try to use build_skb() if we had sufficient tailroom. But we forget to release the unused pages chained via private in big mode which will leak pages. Fixing this by release the pages after building the skb in big mode. Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com> Fixes: fb32856b16ad ("virtio-net: page_to_skb() use build_skb when there's sufficient tailroom") Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
3ede7f84c7
commit
afd92d82c9
@ -423,6 +423,10 @@ static struct sk_buff *page_to_skb(struct virtnet_info *vi,
|
||||
|
||||
skb_reserve(skb, p - buf);
|
||||
skb_put(skb, len);
|
||||
|
||||
page = (struct page *)page->private;
|
||||
if (page)
|
||||
give_pages(rq, page);
|
||||
goto ok;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user