diff options
author | Jiri Slaby <[email protected]> | 2010-06-22 01:41:36 +0000 |
---|---|---|
committer | David S. Miller <[email protected]> | 2010-06-26 22:12:02 -0700 |
commit | d41de3c10047d5f0b661593a8f4610a19f87621f (patch) | |
tree | bb5384b0601f5afa5aff283e9824cc5893c8ec5d | |
parent | cc413d9097dfc6237f37dcaf52346db1061a6119 (diff) |
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: Jiri Slaby <[email protected]>
Cc: Karsten Keil <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Stephen Hemminger <[email protected]>
Cc: Patrick McHardy <[email protected]>
Cc: [email protected]
Signed-off-by: David S. Miller <[email protected]>
-rw-r--r-- | drivers/isdn/hysdn/hysdn_net.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/isdn/hysdn/hysdn_net.c b/drivers/isdn/hysdn/hysdn_net.c index 72eb92647c1b..feec8d89d719 100644 --- a/drivers/isdn/hysdn/hysdn_net.c +++ b/drivers/isdn/hysdn/hysdn_net.c @@ -187,12 +187,13 @@ void hysdn_rx_netpkt(hysdn_card * card, unsigned char *buf, unsigned short len) { struct net_local *lp = card->netif; - struct net_device *dev = lp->dev; + struct net_device *dev; struct sk_buff *skb; if (!lp) return; /* non existing device */ + dev = lp->dev; dev->stats.rx_bytes += len; skb = dev_alloc_skb(len); |