diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2010-06-16 00:43:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-16 00:43:07 -0400 |
commit | fed396a585d8e1870b326f2e8e1888a72957abb8 (patch) | |
tree | b2a291facdc6a259e1851db9a120d05bf5422795 /net/bridge | |
parent | 7e43cd66d36e8f0900e87d9d287c9ee649cbdd07 (diff) |
bridge: Fix OOM crash in deliver_clone
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>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_forward.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c index a98ef1393097..a4e72a89e4ff 100644 --- a/net/bridge/br_forward.c +++ b/net/bridge/br_forward.c | |||
@@ -140,10 +140,10 @@ static int deliver_clone(const struct net_bridge_port *prev, | |||
140 | void (*__packet_hook)(const struct net_bridge_port *p, | 140 | void (*__packet_hook)(const struct net_bridge_port *p, |
141 | struct sk_buff *skb)) | 141 | struct sk_buff *skb)) |
142 | { | 142 | { |
143 | struct net_device *dev = BR_INPUT_SKB_CB(skb)->brdev; | ||
144 | |||
143 | skb = skb_clone(skb, GFP_ATOMIC); | 145 | skb = skb_clone(skb, GFP_ATOMIC); |
144 | if (!skb) { | 146 | if (!skb) { |
145 | struct net_device *dev = BR_INPUT_SKB_CB(skb)->brdev; | ||
146 | |||
147 | dev->stats.tx_dropped++; | 147 | dev->stats.tx_dropped++; |
148 | return -ENOMEM; | 148 | return -ENOMEM; |
149 | } | 149 | } |