From patchwork Sat May 22 14:17:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 154 Return-Path: Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by open-mesh.net (Postfix) with SMTP id 5A36F15442F for ; Sat, 22 May 2010 10:53:42 +0200 (CEST) Received: (qmail invoked by alias); 22 May 2010 14:17:29 -0000 Received: from unknown (EHLO sven-desktop.lazhur.ath.cx) [89.246.221.101] by mail.gmx.net (mp005) with SMTP; 22 May 2010 16:17:29 +0200 X-Authenticated: #15668376 X-Provags-ID: V01U2FsdGVkX19caakabKxc8VuQ0OZRTYZGreTS6Uby6f4lWzLagj 0lg+o1BD/IjZW4 From: Sven Eckelmann To: gregkh@suse.de Date: Sat, 22 May 2010 16:17:07 +0200 Message-Id: <1274537833-2512-4-git-send-email-sven.eckelmann@gmx.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <201005221616.46785.sven.eckelmann@gmx.de> References: <201005221616.46785.sven.eckelmann@gmx.de> X-Y-GMX-Trusted: 0 Cc: b.a.t.m.a.n@lists.open-mesh.net Subject: [B.A.T.M.A.N.] [PATCH 04/10] Staging: batman-adv: Don't call free_netdev twice X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2010 08:53:42 -0000 Free_netdev is registered as destructor in interface_setup for every soft_device. This destructor is automatically called from unregister_netdev and we must not call it again for the freed net_device. Signed-off-by: Sven Eckelmann --- drivers/staging/batman-adv/main.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/staging/batman-adv/main.c b/drivers/staging/batman-adv/main.c index 50a66b4..74c70d5 100644 --- a/drivers/staging/batman-adv/main.c +++ b/drivers/staging/batman-adv/main.c @@ -128,6 +128,9 @@ int init_module(void) unreg_soft_device: unregister_netdev(soft_device); + soft_device = NULL; + return -ENOMEM; + free_soft_device: free_netdev(soft_device); soft_device = NULL;