Skip to contentSkip to conversation

ice: fix an error code in ice_ena_vfs()

PATCH In review Dan Carpenter 2 participants 2 messages Oct 13, 2021 – Oct 14, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +2 -1
index 4d0b643906ff..2bd783ec685c 100644
@@ -1975,7 +1975,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;
Signature · 1 line
2.20.1