From: Qi Zhang Date: Mon, 23 Sep 2019 07:44:25 +0000 (+0800) Subject: net/ice/base: remove null check of port info X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=cfaeec82d2da2b4ba2a5dc793da168e784430e90;p=dpdk.git net/ice/base: remove null check of port info The code in ice_sched_cleanup_all checks whether the port info is NULL prior to calling ice_sched_clear_port. More importantly, it also checks whether the port structure has been initialized by checking its port_state field as well. Signed-off-by: Jacob Keller Signed-off-by: Paul M Stillwell Jr Signed-off-by: Qi Zhang Acked-by: Qiming Yang --- diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c index 6732e291aa..553fc28ff3 100644 --- a/drivers/net/ice/base/ice_sched.c +++ b/drivers/net/ice/base/ice_sched.c @@ -840,8 +840,7 @@ void ice_sched_cleanup_all(struct ice_hw *hw) hw->layer_info = NULL; } - if (hw->port_info) - ice_sched_clear_port(hw->port_info); + ice_sched_clear_port(hw->port_info); hw->num_tx_sched_layers = 0; hw->num_tx_sched_phys_layers = 0;