aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_multicast.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org>2010-03-15 15:26:56 -0400
committerDavid S. Miller <davem@davemloft.net>2010-03-16 17:15:46 -0400
commit8440853bb70010f2f8edc26cb0f7af60da8b2c5a (patch)
treed0f5098be166558deb5baf3292f770dee2d7e326 /net/bridge/br_multicast.c
parent0ba8c9ec25465cd0680b80c0f5836f558e3b972d (diff)
bridge br_multicast: Fix skb leakage in error path.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_multicast.c')
-rw-r--r--net/bridge/br_multicast.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 19618f25b4c6..6980625537ca 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -991,7 +991,7 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,
991 991
992 err = pskb_trim_rcsum(skb2, len); 992 err = pskb_trim_rcsum(skb2, len);
993 if (err) 993 if (err)
994 return err; 994 goto err_out;
995 } 995 }
996 996
997 len -= ip_hdrlen(skb2); 997 len -= ip_hdrlen(skb2);
@@ -1013,7 +1013,7 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,
1013 case CHECKSUM_NONE: 1013 case CHECKSUM_NONE:
1014 skb2->csum = 0; 1014 skb2->csum = 0;
1015 if (skb_checksum_complete(skb2)) 1015 if (skb_checksum_complete(skb2))
1016 return -EINVAL; 1016 goto out;
1017 } 1017 }
1018 1018
1019 err = 0; 1019 err = 0;
@@ -1040,6 +1040,7 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,
1040 1040
1041out: 1041out:
1042 __skb_push(skb2, offset); 1042 __skb_push(skb2, offset);
1043err_out:
1043 if (skb2 != skb) 1044 if (skb2 != skb)
1044 kfree_skb(skb2); 1045 kfree_skb(skb2);
1045 return err; 1046 return err;