From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Date: Thu, 23 May 2013 09:28:05 +0000 (+0800)
Subject: Staging: vt6655: add missing free_netdev() on error in hostap_enable_hostapd()
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3147cf59d144d1d5fa0d7d5574a7d514ae8efe16;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git

Staging: vt6655: add missing free_netdev() on error in hostap_enable_hostapd()

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>
---

diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c
index 46f097d0c841..57a08c5771f2 100644
--- a/drivers/staging/vt6655/hostap.c
+++ b/drivers/staging/vt6655/hostap.c
@@ -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;
 	}