mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
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]>
This commit is contained in:
parent
cc413d9097
commit
d41de3c100
1 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue