Skip to content

Commit

Permalink
Staging: vt6655-6: potential NULL dereference in hostap_disable_hosta…
Browse files Browse the repository at this point in the history
…pd()

We fixed this to use free_netdev() instead of kfree() but unfortunately
free_netdev() doesn't accept NULL pointers.  Smatch complains about
this, it's not something I discovered through testing.

Fixes: 3030d40 ('staging: vt6655: use free_netdev instead of kfree')
Fixes: 0a438d5 ('staging: vt6656: use free_netdev instead of kfree')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Nov 25, 2013
1 parent 3de00ee commit cb4855b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion drivers/staging/vt6655/hostap.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ static int hostap_disable_hostapd(PSDevice pDevice, int rtnl_locked)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Netdevice %s unregistered\n",
pDevice->dev->name, pDevice->apdev->name);
}
free_netdev(pDevice->apdev);
if (pDevice->apdev)
free_netdev(pDevice->apdev);
pDevice->apdev = NULL;
pDevice->bEnable8021x = false;
pDevice->bEnableHostWEP = false;
Expand Down
3 changes: 2 additions & 1 deletion drivers/staging/vt6656/hostap.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ static int hostap_disable_hostapd(struct vnt_private *pDevice, int rtnl_locked)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Netdevice %s unregistered\n",
pDevice->dev->name, pDevice->apdev->name);
}
free_netdev(pDevice->apdev);
if (pDevice->apdev)
free_netdev(pDevice->apdev);
pDevice->apdev = NULL;
pDevice->bEnable8021x = false;
pDevice->bEnableHostWEP = false;
Expand Down

0 comments on commit cb4855b

Please sign in to comment.