summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Lemon <jonathan.lemon@gmail.com>2021-01-06 14:18:36 -0800
committerJakub Kicinski <kuba@kernel.org>2021-01-07 16:06:38 -0800
commit70c4316749f605a31fe31215eb9eceafbd69ec67 (patch)
tree5365bec4aa1d8c4acd40aa76fde8cd2cb3f5daea
parent236a6b1cd585a408139550201343f3f16f9324b9 (diff)
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>
-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);
}