Commit 54069511 authored by Krzysztof Halasa's avatar Krzysztof Halasa Committed by Jeff Garzik

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: default avatarKrzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 2d1ea19d
......@@ -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;
}
......
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