From: Cong Wang Date: Mon, 10 Dec 2018 20:45:45 +0000 (-0800) Subject: tipc: fix a double kfree_skb() X-Git-Tag: v4.19.14~136 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b66ecc4f0b36597ee993b93f3a3a161f8309bab4;p=platform%2Fkernel%2Flinux-rpi.git tipc: fix a double kfree_skb() [ Upstream commit acb4a33e9856d5fa3384b87d3d8369229be06d31 ] tipc_udp_xmit() drops the packet on error, there is no need to drop it again. Fixes: ef20cd4dd163 ("tipc: introduce UDP replicast") Reported-and-tested-by: syzbot+eae585ba2cc2752d3704@syzkaller.appspotmail.com Cc: Ying Xue Cc: Jon Maloy Signed-off-by: Cong Wang Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c index e685af4f..da2d311 100644 --- a/net/tipc/udp_media.c +++ b/net/tipc/udp_media.c @@ -245,10 +245,8 @@ static int tipc_udp_send_msg(struct net *net, struct sk_buff *skb, } err = tipc_udp_xmit(net, _skb, ub, src, &rcast->addr); - if (err) { - kfree_skb(_skb); + if (err) goto out; - } } err = 0; out: