All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH] ice: Fix initialization for num_nodes_added
@ 2018-04-10 17:49 Anirudh Venkataramanan
  2018-04-17 21:13 ` Brelinski, TonyX
  0 siblings, 1 reply; 2+ messages in thread
From: Anirudh Venkataramanan @ 2018-04-10 17:49 UTC (permalink / raw)
  To: intel-wired-lan

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 commit 5513b920a4f7 ("ice: Update Tx scheduler tree for VSI
multi-Tx queue support")

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_sched.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_sched.c b/drivers/net/ethernet/intel/ice/ice_sched.c
index f16ff3e4a840..2e6c1d92cc88 100644
--- a/drivers/net/ethernet/intel/ice/ice_sched.c
+++ b/drivers/net/ethernet/intel/ice/ice_sched.c
@@ -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);
-- 
2.14.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Intel-wired-lan] [PATCH] ice: Fix initialization for num_nodes_added
  2018-04-10 17:49 [Intel-wired-lan] [PATCH] ice: Fix initialization for num_nodes_added Anirudh Venkataramanan
@ 2018-04-17 21:13 ` Brelinski, TonyX
  0 siblings, 0 replies; 2+ messages in thread
From: Brelinski, TonyX @ 2018-04-17 21:13 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Anirudh Venkataramanan
> Sent: Tuesday, April 10, 2018 10:50 AM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH] 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 commit 5513b920a4f7 ("ice: Update Tx scheduler tree for VSI multi-Tx
> queue support")
> 
> Signed-off-by: Anirudh Venkataramanan
> <anirudh.venkataramanan@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_sched.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-17 21:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-10 17:49 [Intel-wired-lan] [PATCH] ice: Fix initialization for num_nodes_added Anirudh Venkataramanan
2018-04-17 21:13 ` Brelinski, TonyX

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.