Skip to content

Commit

Permalink
[PATCH] zd1201: avoid null ptr access of skb->dev
Browse files Browse the repository at this point in the history
skb->dev is not set until eth_type_trans is called...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
John W. Linville committed Oct 18, 2007
1 parent 4937ce8 commit 3ba72b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/wireless/zd1201.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ static void zd1201_usbrx(struct urb *urb)
memcpy(skb_put(skb, 6), &data[datalen-8], 6);
memcpy(skb_put(skb, 2), &data[datalen-24], 2);
memcpy(skb_put(skb, len), data, len);
skb->dev->last_rx = jiffies;
skb->protocol = eth_type_trans(skb, zd->dev);
skb->dev->last_rx = jiffies;
zd->stats.rx_packets++;
zd->stats.rx_bytes += skb->len;
netif_rx(skb);
Expand Down Expand Up @@ -384,8 +384,8 @@ static void zd1201_usbrx(struct urb *urb)
memcpy(skb_put(skb, 2), &data[6], 2);
memcpy(skb_put(skb, len), data+8, len);
}
skb->dev->last_rx = jiffies;
skb->protocol = eth_type_trans(skb, zd->dev);
skb->dev->last_rx = jiffies;
zd->stats.rx_packets++;
zd->stats.rx_bytes += skb->len;
netif_rx(skb);
Expand Down

0 comments on commit 3ba72b2

Please sign in to comment.