Skip to contentSkip to conversation

netdevsim: fix uninit value in nsim_drv_configure_vfs()

PATCH Applied Jakub Kicinski 2 participants 2 messages Nov 1, 2021

Subsystems (3)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 netdevsim: fix uninit value in nsim_drv_configure_vfs()

Build bot points out that I missed initializing ret after refactoring.

Fixes 1c401078bcf3 ("netdevsim: move details of vf config to dev")
---
 drivers/net/netdevsim/dev.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/netdevsim/dev.c +2 -4
index 5db40d713d2a..54345c096a16 100644
@@ -1723,13 +1723,11 @@ int nsim_drv_configure_vfs(struct nsim_bus_dev *nsim_bus_dev,
 			   unsigned int num_vfs)
 {
 	struct nsim_dev *nsim_dev = dev_get_drvdata(&nsim_bus_dev->dev);
-	int ret;
+	int ret = 0;
 
 	mutex_lock(&nsim_dev->vfs_lock);
-	if (nsim_bus_dev->num_vfs == num_vfs) {
-		ret = 0;
+	if (nsim_bus_dev->num_vfs == num_vfs)
 		goto exit_unlock;
-	}
 	if (nsim_bus_dev->num_vfs && num_vfs) {
 		ret = -EBUSY;
 		goto exit_unlock;
Signature · 1 line
2.31.1
#1 lore raw
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Mon, 1 Nov 2021 15:18:45 -0700 you wrote:

Build bot points out that I missed initializing ret after refactoring.

Fixes 1c401078bcf3 ("netdevsim: move details of vf config to dev")

[...]

Here is the summary with links:
- [net-next] netdevsim: fix uninit value in nsim_drv_configure_vfs()

    https://git.kernel.org/netdev/net-next/c/047304d0bfa5

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html