Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757923Ab3EWJ2I (ORCPT ); Thu, 23 May 2013 05:28:08 -0400 Received: from mail-bk0-f52.google.com ([209.85.214.52]:64862 "EHLO mail-bk0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757582Ab3EWJ2G (ORCPT ); Thu, 23 May 2013 05:28:06 -0400 MIME-Version: 1.0 Date: Thu, 23 May 2013 17:28:05 +0800 Message-ID: Subject: [PATCH -next] Staging: vt6655: add missing free_netdev() on error in hostap_enable_hostapd() From: Wei Yongjun To: forest@alittletooquiet.net, gregkh@linuxfoundation.org, joe@perches.com, hemaklnce@gmail.com, marcos.souza.org@gmail.com, peter.p.waskiewicz.jr@intel.com Cc: yongjun_wei@trendmicro.com.cn, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1003 Lines: 29 From: Wei Yongjun Add the missing free_netdev() before return from function hostap_enable_hostapd() in the error handling case. Signed-off-by: Wei Yongjun --- 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; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/