]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
batman-adv: frag: fix primary_if leak on failed linearization
authorSven Eckelmann <sven@narfation.org>
Fri, 3 Jul 2026 19:04:03 +0000 (21:04 +0200)
committerSven Eckelmann <sven@narfation.org>
Mon, 6 Jul 2026 05:18:59 +0000 (07:18 +0200)
If the skb has a frag_list, it must be linearized before it can be split
using skb_split(). But when this step failed, it must not only free the skb
but also take care of the reference to the already found primary_if.

Cc: stable@vger.kernel.org
Reported-by: Sashiko <sashiko-bot@kernel.org>
Fixes: a063f2fba3fa ("batman-adv: Don't skb_split skbuffs with frag_list")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/fragmentation.c

index 13d4689d332dc8fddceb965472fe8c9a2479079b..2e20a2cb64cbf0ffb0f004e0412c4b0a0453f48c 100644 (file)
@@ -547,7 +547,7 @@ int batadv_frag_send_packet(struct sk_buff *skb,
         */
        if (skb_has_frag_list(skb) && __skb_linearize(skb)) {
                ret = -ENOMEM;
-               goto free_skb;
+               goto put_primary_if;
        }
 
        /* Create one header to be copied to all fragments */