From patchwork Sat May 22 14:17:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 165 Return-Path: Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by open-mesh.net (Postfix) with SMTP id 5F270154431 for ; Sat, 22 May 2010 10:53:39 +0200 (CEST) Received: (qmail invoked by alias); 22 May 2010 14:17:26 -0000 Received: from unknown (EHLO sven-desktop.lazhur.ath.cx) [89.246.221.101] by mail.gmx.net (mp019) with SMTP; 22 May 2010 16:17:26 +0200 X-Authenticated: #15668376 X-Provags-ID: V01U2FsdGVkX1/jz3lFTXbjb+nYUCor6BY584JHxQed5BIGp89Rsk 21EPbcykW4PJju From: Sven Eckelmann To: gregkh@suse.de Date: Sat, 22 May 2010 16:17:06 +0200 Message-Id: <1274537833-2512-3-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 03/10] Staging: batman-adv: Call unregister_netdev on failures to get rtnl lock 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:39 -0000 We must call unregister_netdev when we couldn't initialise the batman-adv module and the soft_device was registered. There are two version of the function which we can use: * unregister_netdevice - removes device * unregister_netdev - takes rtnl semaphore and remove device We don't hold the semaphore in an error situation. So we must use unregister_netdev. Signed-off-by: Sven Eckelmann --- drivers/staging/batman-adv/main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/batman-adv/main.c b/drivers/staging/batman-adv/main.c index 9d13979..50a66b4 100644 --- a/drivers/staging/batman-adv/main.c +++ b/drivers/staging/batman-adv/main.c @@ -127,7 +127,7 @@ int init_module(void) return 0; unreg_soft_device: - unregister_netdevice(soft_device); + unregister_netdev(soft_device); free_soft_device: free_netdev(soft_device); soft_device = NULL;