Staging: vt6655: add missing free_netdev() on error in hostap_enable_hostapd()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Thu, 23 May 2013 09:28:05 +0000 (17:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 May 2013 11:46:26 +0000 (20:46 +0900)
Add the missing free_netdev() before return from function
hostap_enable_hostapd() in the error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6655/hostap.c

index 46f097d0c8412a3e53bc573307233d99d89ccb98..57a08c5771f29fd93568fe6fdc0a4d841dbed218 100644 (file)
@@ -104,6 +104,8 @@ static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked)
        if (ret) {
                DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: register_netdevice(AP) failed!\n",
                        dev->name);
+               free_netdev(pDevice->apdev);
+               pDevice->apdev = NULL;
                return -1;
        }