Skip to content

Commit

Permalink
ipv6-multicast: Fix memory leak in input path.
Browse files Browse the repository at this point in the history
Have to free the skb before returning if we fail
the fib lookup.

Signed-off-by: Ben Greear <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
greearb authored and davem330 committed Sep 27, 2011
1 parent 29453f6 commit 2015de5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/ipv6/ip6mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2052,8 +2052,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,
Expand Down

0 comments on commit 2015de5

Please sign in to comment.