Commit 3fe9d0a9 authored by Daniel Schwierzeck's avatar Daniel Schwierzeck Committed by Greg Kroah-Hartman

atm: br2684: Fix oops due to skb->dev being NULL

commit fbe5e29e upstream.

This oops have been already fixed with commit

    27141666

    atm: [br2684] Fix oops due to skb->dev being NULL

    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().

but have been introduced again with commit

    b6211ae7

    atm: Use SKB queue and list helpers instead of doing it by-hand.
Signed-off-by: default avatarDaniel Schwierzeck <daniel.schwierzeck@googlemail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 165b1d34
......@@ -530,12 +530,13 @@ static int br2684_regvcc(struct atm_vcc *atmvcc, void __user * arg)
spin_unlock_irqrestore(&rq->lock, flags);
skb_queue_walk_safe(&queue, skb, tmp) {
struct net_device *dev = skb->dev;
struct net_device *dev;
br2684_push(atmvcc, skb);
dev = skb->dev;
dev->stats.rx_bytes -= skb->len;
dev->stats.rx_packets--;
br2684_push(atmvcc, skb);
}
__module_get(THIS_MODULE);
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment