summaryrefslogtreecommitdiffstats
path: root/net/core/skbuff.c
diff options
context:
space:
mode:
authorJonathan Lemon <jonathan.lemon@gmail.com>2021-01-06 23:18:36 +0100
committerJakub Kicinski <kuba@kernel.org>2021-01-08 01:06:38 +0100
commit70c4316749f605a31fe31215eb9eceafbd69ec67 (patch)
tree5365bec4aa1d8c4acd40aa76fde8cd2cb3f5daea /net/core/skbuff.c
parentskbuff: Call sock_zerocopy_put_abort from skb_zcopy_put_abort (diff)
downloadlinux-70c4316749f605a31fe31215eb9eceafbd69ec67.tar.xz
linux-70c4316749f605a31fe31215eb9eceafbd69ec67.zip
skbuff: Call skb_zcopy_clear() before unref'ing fragments
RX zerocopy fragment pages which are not allocated from the system page pool require special handling. Give the callback in skb_zcopy_clear() a chance to process them first. Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to '')
-rw-r--r--net/core/skbuff.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 5b9cd528d6a6..6d031ed99182 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -605,13 +605,14 @@ static void skb_release_data(struct sk_buff *skb)
&shinfo->dataref))
return;
+ skb_zcopy_clear(skb, true);
+
for (i = 0; i < shinfo->nr_frags; i++)
__skb_frag_unref(&shinfo->frags[i]);
if (shinfo->frag_list)
kfree_skb_list(shinfo->frag_list);
- skb_zcopy_clear(skb, true);
skb_free_head(skb);
}