Skip to content

Commit

Permalink
ISDN: hysdn, fix potential NULL dereference
Browse files Browse the repository at this point in the history
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@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: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jiri Slaby authored and David S. Miller committed Jun 27, 2010
1 parent cc413d9 commit d41de3c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/isdn/hysdn/hysdn_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d41de3c

Please sign in to comment.