diff mbox series

ice: Fix missing error code in ice_ena_vfs()

Message ID 1634292249-63098-1-git-send-email-jiapeng.chong@linux.alibaba.com (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series ice: Fix missing error code in ice_ena_vfs() | expand

Checks

Context Check Description
netdev/cover_letter success Single patches do not need cover letters
netdev/fixes_present success Fixes tag not required for -next series
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cc_maintainers fail 2 blamed authors not CCed: grzegorz.nitka@intel.com wojciech.drewek@intel.com; 2 maintainers not CCed: grzegorz.nitka@intel.com wojciech.drewek@intel.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Fixes tag looks correct
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success No static functions without inline keyword in header files

Commit Message

Jiapeng Chong Oct. 15, 2021, 10:04 a.m. UTC
The error code is missing in this code scenario, add the error code
'-EINVAL' to the return value 'ret'.

Eliminate the follow smatch warning:

drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c:1979 ice_ena_vfs()
warn: missing error code 'ret'.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Fixes: 1c54c839935b ("ice: enable/disable switchdev when managing VFs")
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Grzegorz Nitka Oct. 15, 2021, 2:41 p.m. UTC | #1
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Jiapeng Chong
> Sent: Friday, October 15, 2021 12:04 PM
> To: Brandeburg, Jesse <jesse.brandeburg@intel.com>
> Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org; intel-wired-
> lan@lists.osuosl.org; kuba@kernel.org; davem@davemloft.net
> Subject: [Intel-wired-lan] [PATCH] ice: Fix missing error code in ice_ena_vfs()
> 
> The error code is missing in this code scenario, add the error code
> '-EINVAL' to the return value 'ret'.
> 
> Eliminate the follow smatch warning:
> 
> drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c:1979 ice_ena_vfs()
> warn: missing error code 'ret'.

Seems to be already addressed by Dan Carpenter with this patch:
https://patchwork.ozlabs.org/project/intel-wired-lan/patch/20211013080012.GB6010@kili/

> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Fixes: 1c54c839935b ("ice: enable/disable switchdev when managing VFs")
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
> b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
> index 4d0b643..b2a018c 100644
> --- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
> +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
> @@ -1975,8 +1975,10 @@ static int ice_ena_vfs(struct ice_pf *pf, u16
> num_vfs)
> 
>  	clear_bit(ICE_VF_DIS, pf->state);
> 
> -	if (ice_eswitch_configure(pf))
> +	if (ice_eswitch_configure(pf)) {
> +		ret = -EINVAL;
>  		goto err_unroll_sriov;
> +	}
> 
>  	return 0;
> 
> --
> 1.8.3.1
> 
> _______________________________________________
> Intel-wired-lan mailing list
> Intel-wired-lan@osuosl.org
> https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
index 4d0b643..b2a018c 100644
--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
@@ -1975,8 +1975,10 @@  static int ice_ena_vfs(struct ice_pf *pf, u16 num_vfs)
 
 	clear_bit(ICE_VF_DIS, pf->state);
 
-	if (ice_eswitch_configure(pf))
+	if (ice_eswitch_configure(pf)) {
+		ret = -EINVAL;
 		goto err_unroll_sriov;
+	}
 
 	return 0;