Skip to contentSkip to conversation

bnx2x: Fix missing error code in bnx2x_iov_init_one()

PATCH Applied Jiapeng Chong 3 participants 3 messages May 25, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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'.

---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +3 -1
index d21f085..27943b0 100644
@@ -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);
 
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 10 lines

-----Original Message-----
From: Jiapeng Chong <[email protected]>
Sent: Tuesday, May 25, 2021 4:30 PM
To: Ariel Elior <[email protected]>
Cc: Sudarsana Reddy Kalluru <[email protected]>; GR-everest-linux-l2 <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; Jiapeng Chong <[email protected]>
Subject: [PATCH] bnx2x: Fix missing error code in bnx2x_iov_init_one()

Quoted 4 lines

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]

Quoted 27 lines
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +3 -2
index d21f085..27943b0 100644
@@ -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

#2 lore raw
In reply to Jiapeng Chong
This patch was applied to netdev/net.git (refs/heads/master):

Hello:

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

Quoted 9 lines · 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'.

[...]

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