Skip to content

Commit d332a38

Browse files
refactormanJeff Kirsher
authored andcommitted
ice: Fix initialization for num_nodes_added
ice_sched_add_nodes_to_layer is used recursively, and so we start with num_nodes_added being 0. This way, in case of an error or if num_nodes is NULL, the function just returns 0 to indicate that no nodes were added. Fixes: 5513b92 ("ice: Update Tx scheduler tree for VSI multi-Tx queue support") Signed-off-by: Anirudh Venkataramanan <[email protected]> Tested-by: Tony Brelinski <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 2707df9 commit d332a38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/intel/ice/ice_sched.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,14 +751,14 @@ ice_sched_add_nodes_to_layer(struct ice_port_info *pi,
751751
u16 num_added = 0;
752752
u32 temp;
753753

754+
*num_nodes_added = 0;
755+
754756
if (!num_nodes)
755757
return status;
756758

757759
if (!parent || layer < hw->sw_entry_point_layer)
758760
return ICE_ERR_PARAM;
759761

760-
*num_nodes_added = 0;
761-
762762
/* max children per node per layer */
763763
max_child_nodes =
764764
le16_to_cpu(hw->layer_info[parent->tx_sched_layer].max_children);

0 commit comments

Comments
 (0)