]> err.no Git - linux-2.6/commitdiff
atm: [br2684] Fix oops due to skb->dev being NULL
authorJorge Boncompte [DTI2] <jorge@dti2.net>
Tue, 17 Jun 2008 00:15:33 +0000 (17:15 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 17 Jun 2008 00:15:33 +0000 (17:15 -0700)
It happens that if a packet arrives in a VC between the call to open it on
the hardware and the call to change the backend to br2684, br2684_regvcc
processes the packet and oopses dereferencing skb->dev because it is
NULL before the call to br2684_push().

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>
net/atm/br2684.c

index 9d52ebfc1962b360774f55e728b32ea0d8388654..ac6035046adc9112e665108b9b27578e27c0c384 100644 (file)
@@ -518,9 +518,9 @@ static int br2684_regvcc(struct atm_vcc *atmvcc, void __user * arg)
                struct sk_buff *next = skb->next;
 
                skb->next = skb->prev = NULL;
+               br2684_push(atmvcc, skb);
                BRPRIV(skb->dev)->stats.rx_bytes -= skb->len;
                BRPRIV(skb->dev)->stats.rx_packets--;
-               br2684_push(atmvcc, skb);
 
                skb = next;
        }