Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cb4855b4 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman
Browse files

Staging: vt6655-6: potential NULL dereference in hostap_disable_hostapd()



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: 3030d40b ('staging: vt6655: use free_netdev instead of kfree')
Fixes: 0a438d5b ('staging: vt6656: use free_netdev instead of kfree')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3de00ee4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -143,6 +143,7 @@ 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);
	}
	if (pDevice->apdev)
		free_netdev(pDevice->apdev);
	pDevice->apdev = NULL;
	pDevice->bEnable8021x = false;
+2 −1
Original line number Diff line number Diff line
@@ -133,6 +133,7 @@ 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);
	}
	if (pDevice->apdev)
		free_netdev(pDevice->apdev);
	pDevice->apdev = NULL;
    pDevice->bEnable8021x = false;