From d5a6df44375c88999e94e9ba3bf5c129071fe4cf Mon Sep 17 00:00:00 2001 From: Anirudh Venkataramanan Date: Wed, 16 Nov 2022 13:20:32 +0100 Subject: [PATCH] ice: remove redundant non-null check in ice_setup_pf_sw() Remove a redundant null check, as vsi could not be null at this point. Signed-off-by: Anirudh Venkataramanan Signed-off-by: Przemek Kitszel Reviewed-by: Leon Romanovsky Tested-by: Gurucharan G (A Contingent worker at Intel) Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/ice/ice_main.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index a9a7f8b52140b..d3ebfaf5a04bb 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -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: -- 2.30.2