Merge v3.13-rc2 into staging-next
[firefly-linux-kernel-4.4.55.git] / drivers / staging / vt6655 / hostap.c
index 3d30a435cabda296e43b6ff0c15f3cccccfb439c..ca54b793f9f0273413cb7049cd656349de2cfe4b 100644 (file)
@@ -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;