Skip to content

Commit

Permalink
atm: br2684: Fix oops due to skb->dev being NULL
Browse files Browse the repository at this point in the history
This oops have been already fixed with commit

    2714166

    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

    b6211ae

    atm: Use SKB queue and list helpers instead of doing it by-hand.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Daniel Schwierzeck authored and David S. Miller committed Aug 20, 2011
1 parent 98e7743 commit fbe5e29
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions net/atm/br2684.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,12 +558,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);
}

/* initialize netdev carrier state */
Expand Down

0 comments on commit fbe5e29

Please sign in to comment.