i40e: add an error code check in i40e_vsi_setup
authorSu Hui <suhui@nfschina.com>
Mon, 13 Nov 2023 23:10:21 +0000 (15:10 -0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 15 Nov 2023 04:05:43 +0000 (20:05 -0800)
check the value of 'ret' after calling 'i40e_vsi_config_rss'.

Signed-off-by: Su Hui <suhui@nfschina.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Link: https://lore.kernel.org/r/20231113231047.548659-3-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/intel/i40e/i40e_main.c

index f7a332e51524d1a28b2895cf16ce2c2e22639109..af8491f3211d59523a8b33d59df701900e1a28ba 100644 (file)
@@ -14591,9 +14591,13 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,
        if ((pf->hw_features & I40E_HW_RSS_AQ_CAPABLE) &&
            (vsi->type == I40E_VSI_VMDQ2)) {
                ret = i40e_vsi_config_rss(vsi);
+               if (ret)
+                       goto err_config;
        }
        return vsi;
 
+err_config:
+       i40e_vsi_clear_rings(vsi);
 err_rings:
        i40e_vsi_free_q_vectors(vsi);
 err_msix: