From patchwork Mon Dec 12 11:31:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 1474 Return-Path: Received: from nm24-vm5.bullet.mail.ukl.yahoo.com (nm24-vm5.bullet.mail.ukl.yahoo.com [217.146.176.179]) by open-mesh.org (Postfix) with SMTP id 7F4E1600810 for ; Mon, 12 Dec 2011 12:32:39 +0100 (CET) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@yahoo.de; dkim-adsp=none Received: from [217.146.183.210] by nm24.bullet.mail.ukl.yahoo.com with NNFMP; 12 Dec 2011 11:32:38 -0000 Received: from [77.238.184.80] by tm3.bullet.mail.ukl.yahoo.com with NNFMP; 12 Dec 2011 11:32:38 -0000 Received: from [127.0.0.1] by smtp149.mail.ukl.yahoo.com with NNFMP; 12 Dec 2011 11:32:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1323689558; bh=rrFo40jzh8Q8wqfurSV1xXX54gymlEAvWip5VN6+ld4=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References; b=xIPMoeclbrgwUKzVQmaAGLb+g3NRbohjc1ZMGKxywTsonkoA6kufpPwjZ2T6ZjlRbzJc5W+blGiqax9AaVYO2DkDstRly3dUbqGK1BQ/gbGHmRDfiLVnify63Jghyh7ApqPji+AJsup27dWBr7iPBeLkll/TQOWDe1kEJSUrc0M= X-Yahoo-Newman-Id: 823622.48575.bm@smtp149.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: eksKfigVM1nni8H4aQ4S6nze2rv_AQbkSLnIdcWmEMm2flP mHYHVKU2fwhyRXRLYCqiqM3SGjl1zyGN8C4NP_4RSoMkZPmhB04VqKHVwzsO sx0HHxRJOx1u5qhs2pp1bt_a7nx3ciTYIc4RWAq03QP7bOWQSXmv0duY9eiK ELeA8KplkHNlB.XEqhFBg7HIMgXf97e5qc8jIW6pKex18XwEdIuxc8lXo2ic iDu8v1SFC4GbQQxJc9.3HclAUO.8dvFZ7BjCEtjI6yVr5vX509hMlKOurS9z aNnxkTQI.FVZVfbTyxaId58Ds0aBNnkOxN7lUDALKxHrgHWzZZL8xebSHVLg peS9EhG93l9TZxafw.PsQkBFdJylHvuJOEytN0SQsAQhN8H_KOLiu6.E- X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- Received: from localhost (lindner_marek@210.177.7.38 with plain) by smtp149.mail.ukl.yahoo.com with SMTP; 12 Dec 2011 11:32:37 +0000 GMT From: Marek Lindner To: davem@davemloft.net Date: Mon, 12 Dec 2011 19:31:49 +0800 Message-Id: <1323689516-24427-6-git-send-email-lindner_marek@yahoo.de> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1323689516-24427-1-git-send-email-lindner_marek@yahoo.de> References: <1323689516-24427-1-git-send-email-lindner_marek@yahoo.de> Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org, Simon Wunderlich , Marek Lindner Subject: [B.A.T.M.A.N.] [PATCH 05/11] 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, 12 Dec 2011 11:32:40 -0000 From: Simon Wunderlich 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 Signed-off-by: Sven Eckelmann Signed-off-by: Marek Lindner --- net/batman-adv/soft-interface.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index 45297c8..987c75a 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/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: