[PATCH v2] i40e: add an error code check in i40e_vsi_setup

Su Hui posted 1 patch 2 years, 1 month ago
There is a newer version of this series
drivers/net/ethernet/intel/i40e/i40e_main.c | 4 ++++
1 file changed, 4 insertions(+)
[PATCH v2] i40e: add an error code check in i40e_vsi_setup
Posted by Su Hui 2 years, 1 month ago
check the value of 'ret' after calling 'i40e_vsi_config_rss'.

Signed-off-by: Su Hui <suhui@nfschina.com>
---
v2: 
- call i40e_vsi_clear_rings() to free rings(thank dan carpenter for
  pointing out this).
 drivers/net/ethernet/intel/i40e/i40e_main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index de7fd43dc11c..4904bc8f5777 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -14567,9 +14567,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:
-- 
2.30.2
Re: [PATCH v2] i40e: add an error code check in i40e_vsi_setup
Posted by Dan Carpenter 2 years, 1 month ago
On Fri, Oct 20, 2023 at 10:43:09AM +0800, Su Hui wrote:
> check the value of 'ret' after calling 'i40e_vsi_config_rss'.
> 
> Signed-off-by: Su Hui <suhui@nfschina.com>
> ---
> v2: 
> - call i40e_vsi_clear_rings() to free rings(thank dan carpenter for
>   pointing out this).

Looks okay now.

Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>

regards,
dan carpenter
Re: [PATCH v2] i40e: add an error code check in i40e_vsi_setup
Posted by Jacob Keller 2 years, 1 month ago

On 10/19/2023 11:56 PM, Dan Carpenter wrote:
> On Fri, Oct 20, 2023 at 10:43:09AM +0800, Su Hui wrote:
>> check the value of 'ret' after calling 'i40e_vsi_config_rss'.
>>
>> Signed-off-by: Su Hui <suhui@nfschina.com>
>> ---
>> v2: 
>> - call i40e_vsi_clear_rings() to free rings(thank dan carpenter for
>>   pointing out this).
> 
> Looks okay now.
> 
> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
> 
> regards,
> dan carpenter
> 
> 

For some reason this patch doesn't appear to have hit the
intel-wired-lan list and is thus not being recorded in patchwork for IWL.

Su Hui, would you mind please re-sending this so that it gets picked up
by patchwork? Otherwise I'm afraid that it might get lost inbetween when
Tony returns from vacation.

Thanks,
Jake
Re: [PATCH v2] i40e: add an error code check in i40e_vsi_setup
Posted by Su Hui 2 years, 1 month ago
On 2023/10/21 05:09, Jacob Keller wrote:

>
> On 10/19/2023 11:56 PM, Dan Carpenter wrote:
>> On Fri, Oct 20, 2023 at 10:43:09AM +0800, Su Hui wrote:
>>> check the value of 'ret' after calling 'i40e_vsi_config_rss'.
>>>
>>> Signed-off-by: Su Hui <suhui@nfschina.com>
>>> ---
>>> v2:
>>> - call i40e_vsi_clear_rings() to free rings(thank dan carpenter for
>>>    pointing out this).
>> Looks okay now.
>>
>> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
>>
>> regards,
>> dan carpenter
>>
>>
> For some reason this patch doesn't appear to have hit the
> intel-wired-lan list and is thus not being recorded in patchwork for IWL.
>
> Su Hui, would you mind please re-sending this so that it gets picked up
> by patchwork? Otherwise I'm afraid that it might get lost inbetween when
> Tony returns from vacation.

Sorry for the late reply, I have already resent it[1].

Su Hui

[1] https://lore.kernel.org/all/20231023012024.18757-1-suhui@nfschina.com/