wan/hdlc_x25.c: fix a NULL dereference
WAN: fixes a NULL dereference in hdlc_x25. Reported-by: Adrian Bunk <bunk@kernel.org>. Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
This commit is contained in:
parent
2d1ea19da0
commit
5406951163
|
@ -163,15 +163,17 @@ static void x25_close(struct net_device *dev)
|
|||
|
||||
static int x25_rx(struct sk_buff *skb)
|
||||
{
|
||||
struct net_device *dev = skb->dev;
|
||||
|
||||
if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) {
|
||||
skb->dev->stats.rx_dropped++;
|
||||
dev->stats.rx_dropped++;
|
||||
return NET_RX_DROP;
|
||||
}
|
||||
|
||||
if (lapb_data_received(skb->dev, skb) == LAPB_OK)
|
||||
if (lapb_data_received(dev, skb) == LAPB_OK)
|
||||
return NET_RX_SUCCESS;
|
||||
|
||||
skb->dev->stats.rx_errors++;
|
||||
dev->stats.rx_errors++;
|
||||
dev_kfree_skb_any(skb);
|
||||
return NET_RX_DROP;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue