From: Ben Greear Date: Tue, 27 Sep 2011 19:16:08 +0000 (-0400) Subject: ipv6-multicast: Fix memory leak in input path. X-Git-Tag: firefly_0821_release~7541^2~1718 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=23b139ecf944b097a0493262cbc04886363bd8e6;p=firefly-linux-kernel-4.4.55.git ipv6-multicast: Fix memory leak in input path. [ Upstream commit 2015de5fe2a47086a3260802275932bfd810884e ] Have to free the skb before returning if we fail the fib lookup. Signed-off-by: Ben Greear Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 82a809901f8e..450a1ffdfe0b 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c @@ -2051,8 +2051,10 @@ int ip6_mr_input(struct sk_buff *skb) int err; err = ip6mr_fib_lookup(net, &fl6, &mrt); - if (err < 0) + if (err < 0) { + kfree_skb(skb); return err; + } read_lock(&mrt_lock); cache = ip6mr_cache_find(mrt,