Skip to content

Commit 047304d

Browse files
committed
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 <[email protected]> Fixes: 1c40107 ("netdevsim: move details of vf config to dev") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent d4a07dc commit 047304d

File tree

1 file changed

+2
-4
lines changed
  • drivers/net/netdevsim

1 file changed

+2
-4
lines changed

drivers/net/netdevsim/dev.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1723,13 +1723,11 @@ int nsim_drv_configure_vfs(struct nsim_bus_dev *nsim_bus_dev,
17231723
unsigned int num_vfs)
17241724
{
17251725
struct nsim_dev *nsim_dev = dev_get_drvdata(&nsim_bus_dev->dev);
1726-
int ret;
1726+
int ret = 0;
17271727

17281728
mutex_lock(&nsim_dev->vfs_lock);
1729-
if (nsim_bus_dev->num_vfs == num_vfs) {
1730-
ret = 0;
1729+
if (nsim_bus_dev->num_vfs == num_vfs)
17311730
goto exit_unlock;
1732-
}
17331731
if (nsim_bus_dev->num_vfs && num_vfs) {
17341732
ret = -EBUSY;
17351733
goto exit_unlock;

0 commit comments

Comments
 (0)