From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@google.com, netdev@vger.kernel.org
Cc: Gaosheng Cui <cuigaosheng1@huawei.com>,
anthony.l.nguyen@intel.com,
Maciej Fijalkowski <maciej.fijalkowski@intel.com>,
Marek Szlosek <marek.szlosek@intel.com>
Subject: [PATCH net 3/5] intel/igbvf: free irq on the error path in igbvf_request_msix()
Date: Thu, 16 Mar 2023 10:31:42 -0700 [thread overview]
Message-ID: <20230316173144.2003469-4-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20230316173144.2003469-1-anthony.l.nguyen@intel.com>
From: Gaosheng Cui <cuigaosheng1@huawei.com>
In igbvf_request_msix(), irqs have not been freed on the err path,
we need to free it. Fix it.
Fixes: d4e0fe01a38a ("igbvf: add new driver to support 82576 virtual functions")
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Tested-by: Marek Szlosek <marek.szlosek@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/igbvf/netdev.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
index 3a32809510fc..72cb1b56e9f2 100644
--- a/drivers/net/ethernet/intel/igbvf/netdev.c
+++ b/drivers/net/ethernet/intel/igbvf/netdev.c
@@ -1074,7 +1074,7 @@ static int igbvf_request_msix(struct igbvf_adapter *adapter)
igbvf_intr_msix_rx, 0, adapter->rx_ring->name,
netdev);
if (err)
- goto out;
+ goto free_irq_tx;
adapter->rx_ring->itr_register = E1000_EITR(vector);
adapter->rx_ring->itr_val = adapter->current_itr;
@@ -1083,10 +1083,14 @@ static int igbvf_request_msix(struct igbvf_adapter *adapter)
err = request_irq(adapter->msix_entries[vector].vector,
igbvf_msix_other, 0, netdev->name, netdev);
if (err)
- goto out;
+ goto free_irq_rx;
igbvf_configure_msix(adapter);
return 0;
+free_irq_rx:
+ free_irq(adapter->msix_entries[--vector].vector, netdev);
+free_irq_tx:
+ free_irq(adapter->msix_entries[--vector].vector, netdev);
out:
return err;
}
--
2.38.1
next prev parent reply other threads:[~2023-03-16 17:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-16 17:31 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2023-03-16 (igb, igbvf, igc) Tony Nguyen
2023-03-16 17:31 ` [PATCH net 1/5] igb: revert rtnl_lock() that causes deadlock Tony Nguyen
2023-03-16 17:31 ` [PATCH net 2/5] igb: Enable SR-IOV after reinit Tony Nguyen
2023-03-16 17:31 ` Tony Nguyen [this message]
2023-03-16 17:31 ` [PATCH net 4/5] igbvf: Regard vf reset nack as success Tony Nguyen
2023-03-16 17:31 ` [PATCH net 5/5] igc: fix the validation logic for taprio's gate list Tony Nguyen
2023-03-19 10:50 ` [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2023-03-16 (igb, igbvf, igc) patchwork-bot+netdevbpf
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=20230316173144.2003469-4-anthony.l.nguyen@intel.com \
--to=anthony.l.nguyen@intel.com \
--cc=cuigaosheng1@huawei.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=marek.szlosek@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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).