Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+2 -4
+2 -4
drivers/net/netdevsim/dev.c
··· 1723 1723 unsigned int num_vfs) 1724 1724 { 1725 1725 struct nsim_dev *nsim_dev = dev_get_drvdata(&nsim_bus_dev->dev); 1726 - int ret; 1726 + int ret = 0; 1727 1727 1728 1728 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) 1731 1730 goto exit_unlock; 1732 - } 1733 1731 if (nsim_bus_dev->num_vfs && num_vfs) { 1734 1732 ret = -EBUSY; 1735 1733 goto exit_unlock;