skbuff: Call skb_zcopy_clear() before unref'ing fragments
authorJonathan Lemon <jonathan.lemon@gmail.com>
Wed, 6 Jan 2021 22:18:36 +0000 (14:18 -0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 8 Jan 2021 00:06:38 +0000 (16:06 -0800)
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>
net/core/skbuff.c

index 5b9cd52..6d031ed 100644 (file)
@@ -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);
 }