[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1277206896-27197-1-git-send-email-jslaby@suse.cz>
Date: Tue, 22 Jun 2010 13:41:36 +0200
From: Jiri Slaby <jslaby@...e.cz>
To: isdn@...ux-pingi.de
Cc: linux-kernel@...r.kernel.org, jirislaby@...il.com,
Jiri Slaby <jslaby@...e.cz>,
"David S. Miller" <davem@...emloft.net>,
Stephen Hemminger <shemminger@...tta.com>,
Patrick McHardy <kaber@...sh.net>, netdev@...r.kernel.org
Subject: [PATCH] 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 <jslaby@...e.cz>
Cc: Karsten Keil <isdn@...ux-pingi.de>
Cc: "David S. Miller" <davem@...emloft.net>
Cc: Stephen Hemminger <shemminger@...tta.com>
Cc: Patrick McHardy <kaber@...sh.net>
Cc: netdev@...r.kernel.org
---
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 72eb926..feec8d8 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);
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists