Skip to content

Commit

Permalink
bridge br_multicast: Fix skb leakage in error path.
Browse files Browse the repository at this point in the history
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
YOSHIFUJI Hideaki / 吉藤英明 authored and David S. Miller committed Mar 16, 2010
1 parent 0ba8c9e commit 8440853
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/bridge/br_multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,

err = pskb_trim_rcsum(skb2, len);
if (err)
return err;
goto err_out;
}

len -= ip_hdrlen(skb2);
Expand All @@ -1013,7 +1013,7 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,
case CHECKSUM_NONE:
skb2->csum = 0;
if (skb_checksum_complete(skb2))
return -EINVAL;
goto out;
}

err = 0;
Expand All @@ -1040,6 +1040,7 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,

out:
__skb_push(skb2, offset);
err_out:
if (skb2 != skb)
kfree_skb(skb2);
return err;
Expand Down

0 comments on commit 8440853

Please sign in to comment.