summaryrefslogtreecommitdiff
path: root/drivers/net/netdevsim/dev.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-11-01 15:18:45 -0700
committerJakub Kicinski <kuba@kernel.org>2021-11-01 16:29:56 -0700
commit047304d0bfa5be2ace106974f87eec51e0832cd0 (patch)
tree6ed0f1e846091718f512c78ae320b542356e144b /drivers/net/netdevsim/dev.c
parentd4a07dc5ac34528f292a4f328cf3c65aba312e1b (diff)
netdevsim: fix uninit value in nsim_drv_configure_vfs()
Build bot points out that I missed initializing ret after refactoring. Reported-by: kernel test robot <lkp@intel.com> Fixes: 1c401078bcf3 ("netdevsim: move details of vf config to dev") Link: https://lore.kernel.org/r/20211101221845.3188490-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/netdevsim/dev.c')
-rw-r--r--drivers/net/netdevsim/dev.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c
index 5db40d713d2a..54345c096a16 100644
--- a/drivers/net/netdevsim/dev.c
+++ b/drivers/net/netdevsim/dev.c
@@ -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;