Commit d41de3c1 authored by Jiri Slaby's avatar Jiri Slaby Committed by David S. Miller

ISDN: hysdn, fix potential NULL dereference

Stanse found that lp is dereferenced earlier than checked for being
NULL in hysdn_rx_netpkt. Move the initialization below the test.
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: Patrick McHardy <kaber@trash.net>
Cc: netdev@vger.kernel.org
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cc413d90
...@@ -187,12 +187,13 @@ void ...@@ -187,12 +187,13 @@ void
hysdn_rx_netpkt(hysdn_card * card, unsigned char *buf, unsigned short len) hysdn_rx_netpkt(hysdn_card * card, unsigned char *buf, unsigned short len)
{ {
struct net_local *lp = card->netif; struct net_local *lp = card->netif;
struct net_device *dev = lp->dev; struct net_device *dev;
struct sk_buff *skb; struct sk_buff *skb;
if (!lp) if (!lp)
return; /* non existing device */ return; /* non existing device */
dev = lp->dev;
dev->stats.rx_bytes += len; dev->stats.rx_bytes += len;
skb = dev_alloc_skb(len); skb = dev_alloc_skb(len);
......
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