From: Herbert Xu Date: Thu, 29 Jul 2010 01:12:31 +0000 (+0000) Subject: bridge: Fix skb leak when multicast parsing fails on TX X-Git-Tag: upstream/snapshot3+hdmi~13787^2~9^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6d1d1d398cb7db7a12c5d652d50f85355345234f;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git bridge: Fix skb leak when multicast parsing fails on TX On the bridge TX path we're leaking an skb when br_multicast_rcv returns an error. Reported-by: David Lamparter Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c index 4cec805..f49bcd9 100644 --- a/net/bridge/br_device.c +++ b/net/bridge/br_device.c @@ -48,8 +48,10 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev) rcu_read_lock(); if (is_multicast_ether_addr(dest)) { - if (br_multicast_rcv(br, NULL, skb)) + if (br_multicast_rcv(br, NULL, skb)) { + kfree_skb(skb); goto out; + } mdst = br_mdb_get(br, skb); if (mdst || BR_INPUT_SKB_CB_MROUTERS_ONLY(skb))