diff mbox series

bnx2x: Fix missing error code in bnx2x_iov_init_one()

Message ID 1621940412-73333-1-git-send-email-jiapeng.chong@linux.alibaba.com (mailing list archive)
State Accepted
Commit 65161c35554f7135e6656b3df1ce2c500ca0bdcf
Delegated to: Netdev Maintainers
Headers show
Series bnx2x: Fix missing error code in bnx2x_iov_init_one() | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
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 warning 1 maintainers not CCed: davem@davemloft.net
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
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 Link
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 Link

Commit Message

Jiapeng Chong May 25, 2021, 11 a.m. UTC
Eliminate the follow smatch warning:

drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c:1227
bnx2x_iov_init_one() warn: missing error code 'err'.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Sudarsana Reddy Kalluru May 25, 2021, 12:51 p.m. UTC | #1
> -----Original Message-----
> From: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> Sent: Tuesday, May 25, 2021 4:30 PM
> To: Ariel Elior <aelior@marvell.com>
> Cc: Sudarsana Reddy Kalluru <skalluru@marvell.com>; GR-everest-linux-l2
> <GR-everest-linux-l2@marvell.com>; davem@davemloft.ne;
> kuba@kernel.org; netdev@vger.kernel.org; linux-kernel@vger.kernel.org;
> Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> Subject: [PATCH] bnx2x: Fix missing error code in bnx2x_iov_init_one()
> 
> Eliminate the follow smatch warning:
> 
> drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c:1227
> bnx2x_iov_init_one() warn: missing error code 'err'.

Not sure if it's false positive, variable 'err' is initialized at line 1195.
1194
1195         err = -EIO;
1196         /* verify ari is enabled */

[Changes look ok though]

> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
> b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
> index d21f085..27943b0 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
> @@ -1223,8 +1223,10 @@ int bnx2x_iov_init_one(struct bnx2x *bp, int
> int_mode_param,
>  		goto failed;
> 
>  	/* SR-IOV capability was enabled but there are no VFs*/
> -	if (iov->total == 0)
> +	if (iov->total == 0) {
> +		err = -EINVAL;
>  		goto failed;
> +	}
> 
>  	iov->nr_virtfn = min_t(u16, iov->total, num_vfs_param);
> 
> --
> 1.8.3.1
patchwork-bot+netdevbpf@kernel.org May 25, 2021, 11 p.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Tue, 25 May 2021 19:00:12 +0800 you wrote:
> Eliminate the follow smatch warning:
> 
> drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c:1227
> bnx2x_iov_init_one() warn: missing error code 'err'.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> 
> [...]

Here is the summary with links:
  - bnx2x: Fix missing error code in bnx2x_iov_init_one()
    https://git.kernel.org/netdev/net/c/65161c35554f

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index d21f085..27943b0 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -1223,8 +1223,10 @@  int bnx2x_iov_init_one(struct bnx2x *bp, int int_mode_param,
 		goto failed;
 
 	/* SR-IOV capability was enabled but there are no VFs*/
-	if (iov->total == 0)
+	if (iov->total == 0) {
+		err = -EINVAL;
 		goto failed;
+	}
 
 	iov->nr_virtfn = min_t(u16, iov->total, num_vfs_param);