ice: fix an error code in ice_ena_vfs()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 13 Oct 2021 08:00:12 +0000 (11:00 +0300)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 19 Oct 2021 17:53:28 +0000 (10:53 -0700)
Return the error code if ice_eswitch_configure() fails.  Don't return
success.

Fixes: 1c54c839935b ("ice: enable/disable switchdev when managing VFs")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c

index 862d191..8e3f9ec 100644 (file)
@@ -2015,7 +2015,8 @@ static int ice_ena_vfs(struct ice_pf *pf, u16 num_vfs)
 
        clear_bit(ICE_VF_DIS, pf->state);
 
-       if (ice_eswitch_configure(pf))
+       ret = ice_eswitch_configure(pf);
+       if (ret)
                goto err_unroll_sriov;
 
        return 0;