From patchwork Thu Dec 17 22:34:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Nguyen X-Patchwork-Id: 345340 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79765C4361B for ; Thu, 17 Dec 2020 22:35:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4A9032360D for ; Thu, 17 Dec 2020 22:35:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732148AbgLQWfC (ORCPT ); Thu, 17 Dec 2020 17:35:02 -0500 Received: from mga03.intel.com ([134.134.136.65]:25112 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732093AbgLQWfC (ORCPT ); Thu, 17 Dec 2020 17:35:02 -0500 IronPort-SDR: uPkKWzOBNkKqXU7Q6YfmcOOSKsqYulFoD9BIDgfrzWqFn2UCxt+/0xtbjvbBF/Z4vyMV/XkueR 9j3I4LGSVtMg== X-IronPort-AV: E=McAfee;i="6000,8403,9838"; a="175444100" X-IronPort-AV: E=Sophos;i="5.78,428,1599548400"; d="scan'208";a="175444100" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Dec 2020 14:34:21 -0800 IronPort-SDR: sxFwv9nF/bHbn2VxP+tv+tBqc4R2qDQGqlD32istnV7sAm0m7fUk/snSfU9XfpVx4W64HW+qnq 4P5ZR0wWj6CA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,428,1599548400"; d="scan'208";a="370133355" Received: from anguy11-desk2.jf.intel.com ([10.166.244.147]) by orsmga008.jf.intel.com with ESMTP; 17 Dec 2020 14:34:16 -0800 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org Cc: netdev@vger.kernel.org, sassmann@redhat.com, anthony.l.nguyen@intel.com, Konrad Jankowski Subject: [net 2/2] iavf: fix double-release of rtnl_lock Date: Thu, 17 Dec 2020 14:34:18 -0800 Message-Id: <20201217223418.3134992-3-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201217223418.3134992-1-anthony.l.nguyen@intel.com> References: <20201217223418.3134992-1-anthony.l.nguyen@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jakub Kicinski This code does not jump to exit on an error in iavf_lan_add_device(), so the rtnl_unlock() from the normal path will follow. Fixes: b66c7bc1cd4d ("iavf: Refactor init state machine") Signed-off-by: Jakub Kicinski Reviewed-by: Tony Nguyen Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/iavf/iavf_main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c index 95543dfd4fe7..0a867d64d467 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_main.c +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c @@ -1834,11 +1834,9 @@ static int iavf_init_get_resources(struct iavf_adapter *adapter) netif_tx_stop_all_queues(netdev); if (CLIENT_ALLOWED(adapter)) { err = iavf_lan_add_device(adapter); - if (err) { - rtnl_unlock(); + if (err) dev_info(&pdev->dev, "Failed to add VF to client API service list: %d\n", err); - } } dev_info(&pdev->dev, "MAC address: %pM\n", adapter->hw.mac.addr); if (netdev->features & NETIF_F_GRO)