Skip to content

Commit

Permalink
ice: Fix initialization for num_nodes_added
Browse files Browse the repository at this point in the history
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 <anirudh.venkataramanan@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
  • Loading branch information
Anirudh Venkataramanan authored and Jeff Kirsher committed Apr 24, 2018
1 parent 2707df9 commit d332a38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/intel/ice/ice_sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,14 +751,14 @@ ice_sched_add_nodes_to_layer(struct ice_port_info *pi,
u16 num_added = 0;
u32 temp;

*num_nodes_added = 0;

if (!num_nodes)
return status;

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

*num_nodes_added = 0;

/* max children per node per layer */
max_child_nodes =
le16_to_cpu(hw->layer_info[parent->tx_sched_layer].max_children);
Expand Down

0 comments on commit d332a38

Please sign in to comment.