net/ice/base: remove null check of port info
authorQi Zhang <qi.z.zhang@intel.com>
Mon, 23 Sep 2019 07:44:25 +0000 (15:44 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 7 Oct 2019 13:00:56 +0000 (15:00 +0200)
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 <jacob.e.keller@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
drivers/net/ice/base/ice_sched.c

index 6732e29..553fc28 100644 (file)
@@ -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;