提交 54069511 编写于 作者: K Krzysztof Halasa 提交者: 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: NKrzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
上级 2d1ea19d
...@@ -163,15 +163,17 @@ static void x25_close(struct net_device *dev) ...@@ -163,15 +163,17 @@ static void x25_close(struct net_device *dev)
static int x25_rx(struct sk_buff *skb) static int x25_rx(struct sk_buff *skb)
{ {
struct net_device *dev = skb->dev;
if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) { if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) {
skb->dev->stats.rx_dropped++; dev->stats.rx_dropped++;
return NET_RX_DROP; 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; return NET_RX_SUCCESS;
skb->dev->stats.rx_errors++; dev->stats.rx_errors++;
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return NET_RX_DROP; return NET_RX_DROP;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册