From patchwork Mon Nov 7 12:57:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Wunderlich X-Patchwork-Id: 1359 Return-Path: Received: from nick.hrz.tu-chemnitz.de (nick.hrz.tu-chemnitz.de [134.109.228.11]) by open-mesh.org (Postfix) with ESMTPS id 4AB5560076F for ; Mon, 7 Nov 2011 13:57:51 +0100 (CET) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@tu-chemnitz.de; dkim-adsp=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tu-chemnitz.de; s=dkim2010; h=Message-Id:Date:Subject:Cc:To:From; bh=pjpmT9xBesT1unEeKLMTfvoXNcPHwfg/HJ5OlzSIfKM=; b=vqXOWSYClBDn2ZiipsCkt2wG3RIgZzC63Zfu3Vt/TiJyuPuiCpigbNl8vnkAGJafnC3/hkmGknGnxHAuyHc6jdwJVx29kBt3Q/ZduHu3xJqW5EwXUl4TerafXKwCdyDv1jy8zxmorOyqY5f2aAfFRn09z1kAd5kccXT4p+Ewyds=; Received: from p57aa1484.dip0.t-ipconnect.de ([87.170.20.132] helo=pandem0nium) by nick.hrz.tu-chemnitz.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1RNOlq-0001Qe-NM; Mon, 07 Nov 2011 13:57:50 +0100 Received: from dotslash by pandem0nium with local (Exim 4.72) (envelope-from ) id 1RNOlp-00071M-Gt; Mon, 07 Nov 2011 13:57:49 +0100 From: Simon Wunderlich To: b.a.t.m.a.n@lists.open-mesh.org Date: Mon, 7 Nov 2011 13:57:48 +0100 Message-Id: <1320670668-26961-1-git-send-email-siwu@hrz.tu-chemnitz.de> X-Mailer: git-send-email 1.7.2.5 X-Spam-Score: -1.0 (-) X-Spam-Report: --- Textanalyse SpamAssassin 3.3.1 (-1.0 Punkte) Fragen an/questions to: Postmaster TU Chemnitz * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP --- Ende Textanalyse X-Scan-Signature: 2da4cb75faf7b3f12212370ffd4cc0ae Cc: Simon Wunderlich Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: use unregister_netdevice() when softif_create fails X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.13 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: Mon, 07 Nov 2011 12:57:51 -0000 When entering softif_create(), the rtnl lock has already been acquired by store_mesh_iface(). (store_mesh_iface() -> hardif_enable_interface() -> softif_create) In case of an error, we should therefore call unregister_netdevice() instead of unregister_netdev(). unregister_netdev() tries to acquire the rtnl lock itself and deadlocks in this situation. unregister_netdevice() assumes that the rtnl lock is already been held. Signed-off-by: Simon Wunderlich --- soft-interface.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/soft-interface.c b/soft-interface.c index 45297c8..987c75a 100644 --- a/soft-interface.c +++ b/soft-interface.c @@ -874,7 +874,7 @@ unreg_debugfs: unreg_sysfs: sysfs_del_meshif(soft_iface); unreg_soft_iface: - unregister_netdev(soft_iface); + unregister_netdevice(soft_iface); return NULL; free_soft_iface: