2013-05-23 09:28:08

by Wei Yongjun

[permalink] [raw]
Subject: [PATCH -next] Staging: vt6655: add missing free_netdev() on error in hostap_enable_hostapd()

From: Wei Yongjun <[email protected]>

Add the missing free_netdev() before return from function
hostap_enable_hostapd() in the error handling case.

Signed-off-by: Wei Yongjun <[email protected]>
---
drivers/staging/vt6655/hostap.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c
index 46f097d..57a08c5 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;
}


2013-05-23 14:21:46

by Waskiewicz Jr, Peter P

[permalink] [raw]
Subject: Re: [PATCH -next] Staging: vt6655: add missing free_netdev() on error in hostap_enable_hostapd()

On 05/23/2013 02:28 AM, Wei Yongjun wrote:
> From: Wei Yongjun <[email protected]>
>
> Add the missing free_netdev() before return from function
> hostap_enable_hostapd() in the error handling case.
>
> Signed-off-by: Wei Yongjun <[email protected]>
> ---
> drivers/staging/vt6655/hostap.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c
> index 46f097d..57a08c5 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;
> }
>
>
This looks good to me.

-PJ