Skip to content

Commit

Permalink
bridge: Fix skb leak when multicast parsing fails on TX
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Jul 31, 2010
1 parent a3bdb54 commit 6d1d1d3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/bridge/br_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 6d1d1d3

Please sign in to comment.