Skip to content

Commit 02a2385

Browse files
NicolasDichteldavem330
authored andcommitted
netlink: avoid a double skb free in genlmsg_mcast()
nlmsg_multicast() consumes always the skb, thus the original skb must be freed only when this function is called with a clone. Fixes: cb9f7a9 ("netlink: ensure to loop over all netns in genlmsg_multicast_allns()") Reported-by: Ben Hutchings <[email protected]> Signed-off-by: Nicolas Dichtel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4609adc commit 02a2385

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/netlink/genetlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ static int genlmsg_mcast(struct sk_buff *skb, u32 portid, unsigned long group,
11061106
if (!err)
11071107
delivered = true;
11081108
else if (err != -ESRCH)
1109-
goto error;
1109+
return err;
11101110
return delivered ? 0 : -ESRCH;
11111111
error:
11121112
kfree_skb(skb);

0 commit comments

Comments
 (0)