public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Ciara Loftus <ciara.loftus@intel.com>
To: dev@dpdk.org
Cc: Ciara Loftus <ciara.loftus@intel.com>, stable@dpdk.org
Subject: [PATCH 1/3] net/ice: check for null before dereferencing
Date: Thu, 15 Jan 2026 10:38:21 +0000	[thread overview]
Message-ID: <20260115103824.1982220-2-ciara.loftus@intel.com> (raw)
In-Reply-To: <20260115103824.1982220-1-ciara.loftus@intel.com>

When commiting a new Tx scheduler hierarchy we assume the user has
created a root node. However if they have not, it leads to an invalid
memory access. While this would be an invalid configuration by the user
we should still prevent the invalid memory access from happening. Do so
by ensuring the root node is non null before dereferencing.

Fixes: 715d449a965b ("net/ice: enhance Tx scheduler hierarchy support")
Cc: stable@dpdk.org

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
---
 drivers/net/intel/ice/ice_tm.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/intel/ice/ice_tm.c b/drivers/net/intel/ice/ice_tm.c
index f2d8e12181..db895613cc 100644
--- a/drivers/net/intel/ice/ice_tm.c
+++ b/drivers/net/intel/ice/ice_tm.c
@@ -816,8 +816,13 @@ commit_new_hierarchy(struct rte_eth_dev *dev)
 	uint16_t nodes_created_per_level[ICE_TM_MAX_LAYERS] = {0};
 	uint8_t q_lvl = ice_get_leaf_level(pf);
 	uint8_t qg_lvl = q_lvl - 1;
-
 	struct ice_sched_node *new_vsi_root = hw->vsi_ctx[pf->main_vsi->idx]->sched.vsi_node[0];
+
+	if (sw_root == NULL) {
+		PMD_DRV_LOG(ERR, "No root node defined in TM hierarchy");
+		return -1;
+	}
+
 	/* handle case where VSI node needs to move DOWN the hierarchy */
 	while (new_vsi_root->tx_sched_layer < new_root_level) {
 		if (new_vsi_root->num_children == 0)
-- 
2.43.0


  reply	other threads:[~2026-01-15 10:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-15 10:38 [PATCH 0/3] Ice Tx Scheduler Fixes Ciara Loftus
2026-01-15 10:38 ` Ciara Loftus [this message]
2026-01-15 10:41   ` [PATCH 1/3] net/ice: check for null before dereferencing Bruce Richardson
2026-01-15 10:38 ` [PATCH 2/3] net/ice: fix priority mode printing in Tx scheduler dump Ciara Loftus
2026-01-15 10:55   ` Bruce Richardson
2026-01-15 10:38 ` [PATCH 3/3] net/ice: re-enable strict priority on non-root levels Ciara Loftus
2026-01-15 10:42   ` Bruce Richardson
2026-01-16 14:33 ` [PATCH 0/3] Ice Tx Scheduler Fixes Bruce Richardson

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=20260115103824.1982220-2-ciara.loftus@intel.com \
    --to=ciara.loftus@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.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