Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 02a2385f authored by Nicolas Dichtel's avatar Nicolas Dichtel Committed by David S. Miller
Browse files

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: cb9f7a9a ("netlink: ensure to loop over all netns in genlmsg_multicast_allns()")
Reported-by: default avatarBen Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4609adc2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1106,7 +1106,7 @@ static int genlmsg_mcast(struct sk_buff *skb, u32 portid, unsigned long group,
	if (!err)
		delivered = true;
	else if (err != -ESRCH)
		goto error;
		return err;
	return delivered ? 0 : -ESRCH;
 error:
	kfree_skb(skb);