]> Git Repo - linux.git/commitdiff
bridge: Fix OOM crash in deliver_clone
authorHerbert Xu <[email protected]>
Wed, 16 Jun 2010 04:43:07 +0000 (21:43 -0700)
committerDavid S. Miller <[email protected]>
Wed, 16 Jun 2010 04:43:07 +0000 (21:43 -0700)
The bridge multicast patches introduced an OOM crash in the forward
path, when deliver_clone fails to clone the skb.

Reported-by: Mark Wagner <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/bridge/br_forward.c

index a98ef13930979a129a8d0195e5a94dee3ec7bd2a..a4e72a89e4ffc4eae7a2e7e09963bd0fb58e26a4 100644 (file)
@@ -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;
        }
This page took 0.057253 seconds and 4 git commands to generate.