Skip to content

Commit

Permalink
ipv6-multicast: Fix memory leak in IPv6 multicast.
Browse files Browse the repository at this point in the history
If reg_vif_xmit cannot find a routing entry, be sure to
free the skb before returning the error.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ben Greear authored and David S. Miller committed Sep 27, 2011
1 parent fbe5818 commit 67928c4
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 @@ -696,8 +696,10 @@ static netdev_tx_t reg_vif_xmit(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);
dev->stats.tx_bytes += skb->len;
Expand Down

0 comments on commit 67928c4

Please sign in to comment.