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: 130717 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id CA8D01007D1 for ; Mon, 12 Dec 2011 22:32:45 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752297Ab1LLLck (ORCPT ); Mon, 12 Dec 2011 06:32:40 -0500 Received: from nm24-vm5.bullet.mail.ukl.yahoo.com ([217.146.176.179]:42264 "HELO nm24-vm5.bullet.mail.ukl.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752131Ab1LLLck (ORCPT ); Mon, 12 Dec 2011 06:32:40 -0500 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 Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org, Simon Wunderlich , Simon Wunderlich , Sven Eckelmann , Marek Lindner Subject: [PATCH 05/11] batman-adv: use unregister_netdevice() when softif_create fails 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> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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: