Commit 8440853b authored by YOSHIFUJI Hideaki / 吉藤英明's avatar YOSHIFUJI Hideaki / 吉藤英明 Committed by David S. Miller

bridge br_multicast: Fix skb leakage in error path.

Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0ba8c9ec
...@@ -991,7 +991,7 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br, ...@@ -991,7 +991,7 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,
err = pskb_trim_rcsum(skb2, len); err = pskb_trim_rcsum(skb2, len);
if (err) if (err)
return err; goto err_out;
} }
len -= ip_hdrlen(skb2); len -= ip_hdrlen(skb2);
...@@ -1013,7 +1013,7 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br, ...@@ -1013,7 +1013,7 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,
case CHECKSUM_NONE: case CHECKSUM_NONE:
skb2->csum = 0; skb2->csum = 0;
if (skb_checksum_complete(skb2)) if (skb_checksum_complete(skb2))
return -EINVAL; goto out;
} }
err = 0; err = 0;
...@@ -1040,6 +1040,7 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br, ...@@ -1040,6 +1040,7 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,
out: out:
__skb_push(skb2, offset); __skb_push(skb2, offset);
err_out:
if (skb2 != skb) if (skb2 != skb)
kfree_skb(skb2); kfree_skb(skb2);
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment