Skip to content

Commit

Permalink
net/ice: add check for null-pointer dereference
Browse files Browse the repository at this point in the history
Although it should never occur that the teid (scheduler node id) value
for a txq is incorrect, put in a check for null following the scheduler
node lookup in ice_tm_setup_txq_node. This provides some additional
safety and should eliminate a coverity issue too.

Coverity issue: 448957
Fixes: 715d449 ("net/ice: enhance Tx scheduler hierarchy support")

Signed-off-by: Bruce Richardson <[email protected]>
Acked-by: Ian Stokes <[email protected]>
  • Loading branch information
bruce-richardson committed Nov 19, 2024
1 parent 84f6347 commit 4561981
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/ice/ice_tm.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,10 @@ ice_tm_setup_txq_node(struct ice_pf *pf, struct ice_hw *hw, uint16_t qid, uint32
struct ice_sched_node *hw_node = ice_sched_find_node_by_teid(hw->port_info->root, teid);
struct ice_tm_node *sw_node = find_node(pf->tm_conf.root, qid);

/* bad node teid passed */
if (hw_node == NULL)
return -ENOENT;

/* not configured in hierarchy */
if (sw_node == NULL)
return 0;
Expand Down

0 comments on commit 4561981

Please sign in to comment.