From patchwork Wed May 19 19:10:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 163 Return-Path: Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by open-mesh.net (Postfix) with SMTP id 99F3A1542F6 for ; Wed, 19 May 2010 15:47:13 +0200 (CEST) Received: (qmail invoked by alias); 19 May 2010 19:10:59 -0000 Received: from unknown (EHLO sven-desktop.lazhur.ath.cx) [89.246.192.108] by mail.gmx.net (mp067) with SMTP; 19 May 2010 21:10:59 +0200 X-Authenticated: #15668376 X-Provags-ID: V01U2FsdGVkX1/Z4b88vsjZbcawbkpFTwwkfNMclxUIa4VgPenBYX PLjcMCOLFtzh1A From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Wed, 19 May 2010 21:10:52 +0200 Message-Id: <1274296252-17783-1-git-send-email-sven.eckelmann@gmx.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1274269428-13203-1-git-send-email-sven.eckelmann@gmx.de> References: <1274269428-13203-1-git-send-email-sven.eckelmann@gmx.de> X-Y-GMX-Trusted: 0 Subject: [B.A.T.M.A.N.] [PATCH-maint] 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: Wed, 19 May 2010 13:47:15 -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 a error case. So we must use unregister_netdev. Signed-off-by: Sven Eckelmann --- This patch is created for maint and should be applied using `git am`. Following patches should be applied before: * batman-adv: Move device for icmp injection to debugfs * batman-adv: Move tables from sysfs to debugfs main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/main.c b/main.c index 770625f..6e6d925 100644 --- a/main.c +++ b/main.c @@ -137,7 +137,7 @@ int init_module(void) unreg_sysfs: sysfs_del_meshif(soft_device); unreg_soft_device: - unregister_netdevice(soft_device); + unregister_netdev(soft_device); free_soft_device: free_netdev(soft_device); soft_device = NULL;