Skip to content

Commit

Permalink
netdevsim: fix uninit value in nsim_drv_configure_vfs()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
kuba-moo committed Nov 1, 2021
1 parent d4a07dc commit 047304d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/netdevsim/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 047304d

Please sign in to comment.