From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>,
Gurucharan G <gurucharanx.g@intel.com>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
Sasha Levin <sashal@kernel.org>,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, intel-wired-lan@lists.osuosl.org,
netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 5.15 14/36] ice: add missing checks for PF vsi type
Date: Sun, 26 Feb 2023 09:48:22 -0500 [thread overview]
Message-ID: <20230226144845.827893-14-sashal@kernel.org> (raw)
In-Reply-To: <20230226144845.827893-1-sashal@kernel.org>
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
[ Upstream commit 6a8d013e904ad9a66706fcc926ec9993bed7d190 ]
There were a few places we had missed checking the VSI type to make sure
it was definitely a PF VSI, before calling setup functions intended only
for the PF VSI.
This doesn't fix any explicit bugs but cleans up the code in a few
places and removes one explicit != vsi->type check that can be
superseded by this code (it's a super set)
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/ice/ice_main.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 6f674cd117d3d..13afbffc4758a 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -5477,15 +5477,12 @@ int ice_vsi_cfg(struct ice_vsi *vsi)
{
int err;
- if (vsi->netdev) {
+ if (vsi->netdev && vsi->type == ICE_VSI_PF) {
ice_set_rx_mode(vsi->netdev);
- if (vsi->type != ICE_VSI_LB) {
- err = ice_vsi_vlan_setup(vsi);
-
- if (err)
- return err;
- }
+ err = ice_vsi_vlan_setup(vsi);
+ if (err)
+ return err;
}
ice_vsi_cfg_dcb_rings(vsi);
@@ -5651,7 +5648,7 @@ static int ice_up_complete(struct ice_vsi *vsi)
if (vsi->port_info &&
(vsi->port_info->phy.link_info.link_info & ICE_AQ_LINK_UP) &&
- vsi->netdev) {
+ vsi->netdev && vsi->type == ICE_VSI_PF) {
ice_print_link_msg(vsi, true);
netif_tx_start_all_queues(vsi->netdev);
netif_carrier_on(vsi->netdev);
@@ -5661,7 +5658,9 @@ static int ice_up_complete(struct ice_vsi *vsi)
* set the baseline so counters are ready when interface is up
*/
ice_update_eth_stats(vsi);
- ice_service_task_schedule(pf);
+
+ if (vsi->type == ICE_VSI_PF)
+ ice_service_task_schedule(pf);
return 0;
}
--
2.39.0
next prev parent reply other threads:[~2023-02-26 14:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-26 14:48 [PATCH AUTOSEL 5.15 01/36] wifi: ath9k: Fix use-after-free in ath9k_hif_usb_disconnect() Sasha Levin
2023-02-26 14:48 ` [PATCH AUTOSEL 5.15 02/36] wifi: brcmfmac: Fix potential stack-out-of-bounds in brcmf_c_preinit_dcmds() Sasha Levin
2023-02-26 14:48 ` [PATCH AUTOSEL 5.15 06/36] wifi: ath11k: debugfs: fix to work with multiple PCI devices Sasha Levin
2023-02-26 14:48 ` [PATCH AUTOSEL 5.15 10/36] wifi: brcmfmac: ensure CLM version is null-terminated to prevent stack-out-of-bounds Sasha Levin
2023-02-26 14:48 ` [PATCH AUTOSEL 5.15 11/36] wifi: mt7601u: fix an integer underflow Sasha Levin
2023-02-26 14:48 ` [PATCH AUTOSEL 5.15 12/36] inet: fix fast path in __inet_hash_connect() Sasha Levin
2023-02-26 14:48 ` [PATCH AUTOSEL 5.15 13/36] ice: restrict PTP HW clock freq adjustments to 100, 000, 000 PPB Sasha Levin
2023-02-26 14:48 ` Sasha Levin [this message]
2023-02-26 14:48 ` [PATCH AUTOSEL 5.15 19/36] netpoll: Remove 4s sleep during carrier detection Sasha Levin
2023-02-26 14:48 ` [PATCH AUTOSEL 5.15 20/36] net: bcmgenet: Add a check for oversized packets Sasha Levin
2023-02-26 14:48 ` [PATCH AUTOSEL 5.15 22/36] netfilter: nf_tables: NULL pointer dereference in nf_tables_updobj() Sasha Levin
2023-02-26 14:48 ` [PATCH AUTOSEL 5.15 24/36] wifi: mt76: dma: free rx_head in mt76_dma_rx_cleanup Sasha Levin
2023-02-26 14:48 ` [PATCH AUTOSEL 5.15 26/36] net/mlx5: fw_tracer: Fix debug print Sasha Levin
2023-02-26 14:48 ` [PATCH AUTOSEL 5.15 34/36] hv_netvsc: Check status in SEND_RNDIS_PKT completion message Sasha Levin
2023-02-26 14:48 ` [PATCH AUTOSEL 5.15 35/36] devlink: health: Fix nla_nest_end in error flow Sasha Levin
2023-02-26 14:48 ` [PATCH AUTOSEL 5.15 36/36] scm: add user copy checks to put_cmsg() Sasha Levin
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=20230226144845.827893-14-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gurucharanx.g@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jesse.brandeburg@intel.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
/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).