Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3849952pxv; Tue, 13 Jul 2021 05:23:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJPEdFy1l1iMFvJ1EE0Y2BYBXiI6qe3BkhFoCtsaomGKCbo1kDpenMrTew9WDjOaHvwlZi X-Received: by 2002:a17:907:77ca:: with SMTP id kz10mr5311872ejc.22.1626178981421; Tue, 13 Jul 2021 05:23:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626178981; cv=none; d=google.com; s=arc-20160816; b=NKu35/B1oydqXqZ/uChbFeJ5HBvBZuluFhRwuvpRSRDw1OJhSWWmTMbO+rMqjXMxCE P0LyvIdLq1ThNYmlQRAi+l4Uzhv+VscluBwFNz+sIpfgH3c4qTUE7FOvuyveky3Qce5D Zbad3Elss2yobPJ57Xgd76NSuQyAkmygu/ZlX90k5PLgMBuu9kmYf2f7Y31yy0+7tz/P RROFpIYAE9qgnbU/KyxYCUHkLPSqWaBSx7l/U2SbZPKjzX0FaxJU2jK4PBVfKTROMPX/ L3cSC4TgVKP9Z5ot5gDoSOcsDhzdDbBmm+kUgSKVCOKjLyOQK/OMvr2OlENTgE5N/624 CBWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=N12Qt0FbX8/A1qRMnGp6XJs1s3QP6zmQUn6Y4fY3u94=; b=TWW+HahIBDAn2Qvy5pF7t3kW/pK9Wf0QCte4/tTg420wGCxEwbVxLc7aO//CrtRm/k ZBBt4qHYDiRIYTRDE6Xmx6JdYewxpB5eomZLg2Yg5S+A3e9/X8oXG3rvuBE0rHq2d9kI eEeA+p3BptAoLF5KKliSzVxXYBOdFQS+78e/BBui5uhKazF2srr5eZ0bRnRuOVyD+uWL 4B0eYI389e38u61YCXNO2CALslJkx5qHJIAs+laibnshcz50giJ7BY8GN7bIQEYWSdFI p4JB8NX1a91WRjXs3KnqKuGSyYKJ/t3pacB+1p3OMDBWWB4kjDJ6djnOhBTAxp0GOJGs KCjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hfylIuaT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kf22si4185797ejc.5.2021.07.13.05.22.38; Tue, 13 Jul 2021 05:23:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hfylIuaT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236209AbhGMMXe (ORCPT + 99 others); Tue, 13 Jul 2021 08:23:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236085AbhGMMXd (ORCPT ); Tue, 13 Jul 2021 08:23:33 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21210C0613DD; Tue, 13 Jul 2021 05:20:43 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id p36so9699181pfw.11; Tue, 13 Jul 2021 05:20:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=N12Qt0FbX8/A1qRMnGp6XJs1s3QP6zmQUn6Y4fY3u94=; b=hfylIuaTT2n81A+A5vS0z3hJLKe3dvZTZw1MoT9Kpifs+cFkL+LOJ9zq0o130wRkqe nnp+KeDfqvAkInKZO3PvoCSx5716riVxvltU0TobGnesfnbMUAFW1AExyChi37nacWKK OywwrydZum1BJGoqpIU5hjWDX6+XFc9b2T2t+5qkuPJtlaXoeXcjAKFgKie8bZgh9nrI I8Q4gIIn5jIS6T4NcUR3+MOqgVaH3zA2j18/gTyjVqaagGUymW4TV7U4uV7ZCXYxHbe1 BrvS8Sce5SrcltkHn4cuuqSxCL9nncOx7u9/iD9b783lq50K4aDs0ZE6sPge+FHGuLxn SkBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=N12Qt0FbX8/A1qRMnGp6XJs1s3QP6zmQUn6Y4fY3u94=; b=l4Pw72NF55FxfhElqKtW9h6c1ukdUfe5kdJ1IS+PI6Hwzl9fosSwhntA4r2YGzcPio xy2UOPODQv5cQxhRnEn7a2BZJNmGHWCk81dsNZiiIwjHEfRIS4O5+h4//kFlvnBQrhwk RAH1vDN9zSogGpVogPG43QqSo4rRVsvrHKnhLdLrWcoPVdQ2bhmYTMTX+PiqwUDI9QiP 1Wk6Rnws7ylkAd2je4y2Kgstc5d7hLd7XMCZZVX2S/qkbNo7mk7vwl9xRfmvVEP1mNyP 6oOIidaMbobP77zzEoHZpM5jPqoBa+oOjrG+7rZSDX6IPf6Sft5KLyiGmAGGjdfSq8MQ a98A== X-Gm-Message-State: AOAM532n0e7ohkcLcQfdV8o2gqPpAGEycJyifQm5I89UYMlcHAk+Ueai QPeDpool9Zin/iss2BUip7k= X-Received: by 2002:aa7:90c8:0:b029:32c:935f:de5f with SMTP id k8-20020aa790c80000b029032c935fde5fmr4380311pfk.79.1626178842534; Tue, 13 Jul 2021 05:20:42 -0700 (PDT) Received: from localhost.localdomain ([154.16.166.218]) by smtp.gmail.com with ESMTPSA id d14sm20248253pfv.171.2021.07.13.05.20.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 05:20:41 -0700 (PDT) From: Dongliang Mu To: Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Jakub Kicinski , Dinghao Liu , Jeff Kirsher , Shannon Nelson , Catherine Sullivan Cc: Dongliang Mu , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] i40e: Fix error handling code of label err_set_queues Date: Tue, 13 Jul 2021 20:20:27 +0800 Message-Id: <20210713122028.463450-1-mudongliangabcd@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If i40e_up_complete fails in i40e_vsi_open, it goes to err_up_complete. The label err_set_queues has an issue: if the else branch is executed, there is no need to execute i40e_vsi_request_irq. Fix this by adding a condition of i40e_vsi_free_irq. Reported-by: Dongliang Mu (mudongliangabcd@gmail.com) Fixes: 9c04cfcd4aad ("i40e: Fix error handling in i40e_vsi_open") Fixes: c22e3c6c7912 ("i40e: prep vsi_open logic for non-netdev cases") Signed-off-by: Dongliang Mu --- drivers/net/ethernet/intel/i40e/i40e_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 861e59a350bd..ae54468c7001 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -8720,7 +8720,8 @@ int i40e_vsi_open(struct i40e_vsi *vsi) err_up_complete: i40e_down(vsi); err_set_queues: - i40e_vsi_free_irq(vsi); + if ((vsi->netdev) || (vsi->type == I40E_VSI_FDIR)) + i40e_vsi_free_irq(vsi); err_setup_rx: i40e_vsi_free_rx_resources(vsi); err_setup_tx: -- 2.25.1