Skip to contentSkip to conversation

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

PATCH In review Jorge Boncompte [DTI2] 2 participants 2 messages Jun 5, 2008 – Jun 14, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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().

---
 net/atm/br2684.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/atm/br2684.c +1 -1
index 9d52ebf..ac60350 100644
@@ -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;
 	}
#1 lore raw
Quoted 7 lines · In message <[email protected]>,"Jorge Boncompte [DTI2]" writes:

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

looks good. i will submit to davem with the next batch of atm patches.