From: Dan Carpenter Date: Wed, 13 Oct 2021 08:00:12 +0000 (+0300) Subject: ice: fix an error code in ice_ena_vfs() X-Git-Tag: v5.16-rc1~159^2~144^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8702ed0b0de146c980883896b4cbb40ce860142e;p=thirdparty%2Flinux.git ice: fix an error code in ice_ena_vfs() 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 Reviewed-by: Simon Horman Signed-off-by: Tony Nguyen --- diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c index 862d191284ba7..8e3f9ec4e35b0 100644 --- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c @@ -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;