Skip to content

Commit

Permalink
bridge: Fix OOM crash in deliver_clone
Browse files Browse the repository at this point in the history
The bridge multicast patches introduced an OOM crash in the forward
path, when deliver_clone fails to clone the skb.

Reported-by: Mark Wagner <mwagner@redhat.com>
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 Jun 16, 2010
1 parent 7e43cd6 commit fed396a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/bridge/br_forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ static int deliver_clone(const struct net_bridge_port *prev,
void (*__packet_hook)(const struct net_bridge_port *p,
struct sk_buff *skb))
{
struct net_device *dev = BR_INPUT_SKB_CB(skb)->brdev;

skb = skb_clone(skb, GFP_ATOMIC);
if (!skb) {
struct net_device *dev = BR_INPUT_SKB_CB(skb)->brdev;

dev->stats.tx_dropped++;
return -ENOMEM;
}
Expand Down

0 comments on commit fed396a

Please sign in to comment.