ice: remove redundant non-null check in ice_setup_pf_sw()
authorAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Wed, 16 Nov 2022 12:20:32 +0000 (13:20 +0100)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Thu, 19 Jan 2023 16:18:03 +0000 (08:18 -0800)
Remove a redundant null check, as vsi could not be null at this point.

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_main.c

index a9a7f8b52140b4a6e98126a678b07c567ecc5c24..d3ebfaf5a04bb5235cf0b39603758734167ceca5 100644 (file)
@@ -3780,13 +3780,11 @@ static int ice_setup_pf_sw(struct ice_pf *pf)
 unroll_napi_add:
        ice_tc_indir_block_unregister(vsi);
 unroll_cfg_netdev:
-       if (vsi) {
-               ice_napi_del(vsi);
-               if (vsi->netdev) {
-                       clear_bit(ICE_VSI_NETDEV_ALLOCD, vsi->state);
-                       free_netdev(vsi->netdev);
-                       vsi->netdev = NULL;
-               }
+       ice_napi_del(vsi);
+       if (vsi->netdev) {
+               clear_bit(ICE_VSI_NETDEV_ALLOCD, vsi->state);
+               free_netdev(vsi->netdev);
+               vsi->netdev = NULL;
        }
 
 unroll_vsi_setup: