bridge: Fix skb leak when multicast parsing fails on TX
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 29 Jul 2010 01:12:31 +0000 (01:12 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 31 Jul 2010 06:36:57 +0000 (23:36 -0700)
On the bridge TX path we're leaking an skb when br_multicast_rcv
returns an error.

Reported-by: David Lamparter <equinox@diac24.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_device.c

index 4cec8051164d6fb59212d83317b778569879043f..f49bcd9d9113cad7bde8e95d557d42329eeddf46 100644 (file)
@@ -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))