Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752659AbbHCDgx (ORCPT ); Sun, 2 Aug 2015 23:36:53 -0400 Received: from m50-138.163.com ([123.125.50.138]:52453 "EHLO m50-138.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751925AbbHCDgw (ORCPT ); Sun, 2 Aug 2015 23:36:52 -0400 From: Jia-Ju Bai To: jeffrey.t.kirsher@intel.com, jesse.brandeburg@intel.com Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] igb: Fix a deadlock in igb_sriov_reinit Date: Mon, 3 Aug 2015 11:36:26 +0800 Message-Id: <1438572986-32708-1-git-send-email-baijiaju1990@163.com> X-Mailer: git-send-email 1.7.9.5 X-CM-TRANSID: C9GowAAnX7e94b5VuXt4AQ--.31568S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrZF17KF45Ww4fZr4UXF4xWFg_yoWfJrc_Gr nrZFWrXr45Kr1Fkr40yr4av3yq9ryvqry8Cw4ftrWa9F17Cr13Gw1DXr93WFWkW34fCa4D CrnIqF1Iyw1jkjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUntKItUUUUU== X-Originating-IP: [173.252.200.40] X-CM-SenderInfo: xedlyx5dmximizq6il2tof0z/1tbiZQtLelWBK9elSgAAsY Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1052 Lines: 30 When igb_init_interrupt_scheme in igb_sriov_reinit is failed, the lock acquired by rtnl_lock() is not released, which causes a deadlock. This patch adds rtnl_unlock() in error handling to fix it. Signed-off-by: Jia-Ju Bai --- drivers/net/ethernet/intel/igb/igb_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 2f70a9b..311d1ca 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -7539,6 +7539,7 @@ static int igb_sriov_reinit(struct pci_dev *dev) if (igb_init_interrupt_scheme(adapter, true)) { dev_err(&pdev->dev, "Unable to allocate memory for queues\n"); + rtnl_unlock(); return -ENOMEM; } -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/