* [PATCH] bnx2x: Fix missing error code in bnx2x_iov_init_one()
@ 2021-05-25 11:00 Jiapeng Chong
2021-05-25 12:51 ` Sudarsana Reddy Kalluru
2021-05-25 23:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Jiapeng Chong @ 2021-05-25 11:00 UTC (permalink / raw)
To: aelior
Cc: skalluru, GR-everest-linux-l2, davem, kuba, netdev, linux-kernel,
Jiapeng Chong
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(-)
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH] bnx2x: Fix missing error code in bnx2x_iov_init_one()
2021-05-25 11:00 [PATCH] bnx2x: Fix missing error code in bnx2x_iov_init_one() Jiapeng Chong
@ 2021-05-25 12:51 ` Sudarsana Reddy Kalluru
2021-05-25 23:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Sudarsana Reddy Kalluru @ 2021-05-25 12:51 UTC (permalink / raw)
To: Jiapeng Chong, Ariel Elior
Cc: GR-everest-linux-l2, davem, kuba, netdev, linux-kernel
> -----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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] bnx2x: Fix missing error code in bnx2x_iov_init_one()
2021-05-25 11:00 [PATCH] bnx2x: Fix missing error code in bnx2x_iov_init_one() Jiapeng Chong
2021-05-25 12:51 ` Sudarsana Reddy Kalluru
@ 2021-05-25 23:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-05-25 23:00 UTC (permalink / raw)
To: Jiapeng Chong
Cc: aelior, skalluru, GR-everest-linux-l2, davem, kuba, netdev, linux-kernel
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-05-25 23:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25 11:00 [PATCH] bnx2x: Fix missing error code in bnx2x_iov_init_one() Jiapeng Chong
2021-05-25 12:51 ` Sudarsana Reddy Kalluru
2021-05-25 23:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).