linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dongliang Mu <mudongliangabcd@gmail.com>
To: Jesse Brandeburg <jesse.brandeburg@intel.com>,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Dinghao Liu <dinghao.liu@zju.edu.cn>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
	Shannon Nelson <shannon.nelson@intel.com>,
	Catherine Sullivan <catherine.sullivan@intel.com>
Cc: Dongliang Mu <mudongliangabcd@gmail.com>,
	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	[thread overview]
Message-ID: <20210713122028.463450-1-mudongliangabcd@gmail.com> (raw)

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 <mudongliangabcd@gmail.com>
---
 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


             reply	other threads:[~2021-07-13 12:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13 12:20 Dongliang Mu [this message]
2021-07-13 15:16 ` [PATCH] i40e: Fix error handling code of label err_set_queues Shannon Nelson
2021-07-14  2:24   ` Dongliang Mu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210713122028.463450-1-mudongliangabcd@gmail.com \
    --to=mudongliangabcd@gmail.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=catherine.sullivan@intel.com \
    --cc=davem@davemloft.net \
    --cc=dinghao.liu@zju.edu.cn \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shannon.nelson@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).