Hi Liu, [FYI, it's a private test report for your RFC patch.] [auto build test WARNING on hch-configfs/for-next] [cannot apply to joro-iommu/next awilliam-vfio/next linus/master v5.15-rc1 next-20210917] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Liu-Yi-L/Introduce-dev-iommu-for-userspace-I-O-address-space-management/20210919-144631 base: git://git.infradead.org/users/hch/configfs.git for-next config: i386-randconfig-a016-20210919 (attached as .config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c8b3d7d6d6de37af68b2f379d0e37304f78e115f) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/0day-ci/linux/commit/262b8a31d0b9bbcb24f7fc2eed5e7ac849265047 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Liu-Yi-L/Introduce-dev-iommu-for-userspace-I-O-address-space-management/20210919-144631 git checkout 262b8a31d0b9bbcb24f7fc2eed5e7ac849265047 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=i386 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> drivers/iommu/iommufd/iommufd.c:205:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (refcount_read(&ioas->refs) > 1) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/iommu/iommufd/iommufd.c:213:9: note: uninitialized use occurs here return ret; ^~~ drivers/iommu/iommufd/iommufd.c:205:2: note: remove the 'if' if its condition is always true if (refcount_read(&ioas->refs) > 1) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/iommu/iommufd/iommufd.c:189:17: note: initialize the variable 'ret' to silence this warning int ioasid, ret; ^ = 0 drivers/iommu/iommufd/iommufd.c:369:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (idev->dev == dev || idev->dev_cookie == dev_cookie) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/iommu/iommufd/iommufd.c:409:17: note: uninitialized use occurs here return ERR_PTR(ret); ^~~ drivers/iommu/iommufd/iommufd.c:369:3: note: remove the 'if' if its condition is always false if (idev->dev == dev || idev->dev_cookie == dev_cookie) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/iommu/iommufd/iommufd.c:369:7: warning: variable 'ret' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized] if (idev->dev == dev || idev->dev_cookie == dev_cookie) { ^~~~~~~~~~~~~~~~ drivers/iommu/iommufd/iommufd.c:409:17: note: uninitialized use occurs here return ERR_PTR(ret); ^~~ drivers/iommu/iommufd/iommufd.c:369:7: note: remove the '||' if its condition is always false if (idev->dev == dev || idev->dev_cookie == dev_cookie) { ^~~~~~~~~~~~~~~~~~~ drivers/iommu/iommufd/iommufd.c:359:9: note: initialize the variable 'ret' to silence this warning int ret; ^ = 0 3 warnings generated. Kconfig warnings: (for reference only) WARNING: unmet direct dependencies detected for IOMMUFD Depends on IOMMU_SUPPORT Selected by - VFIO_PCI && VFIO && PCI && EVENTFD && MMU vim +205 drivers/iommu/iommufd/iommufd.c 185 186 static int iommufd_ioasid_free(struct iommufd_ctx *ictx, unsigned long arg) 187 { 188 struct iommufd_ioas *ioas = NULL; 189 int ioasid, ret; 190 191 if (copy_from_user(&ioasid, (void __user *)arg, sizeof(ioasid))) 192 return -EFAULT; 193 194 if (ioasid < 0) 195 return -EINVAL; 196 197 mutex_lock(&ictx->lock); 198 ioas = xa_load(&ictx->ioasid_xa, ioasid); 199 if (IS_ERR(ioas)) { 200 ret = -EINVAL; 201 goto out_unlock; 202 } 203 204 /* Disallow free if refcount is not 1 */ > 205 if (refcount_read(&ioas->refs) > 1) { 206 ret = -EBUSY; 207 goto out_unlock; 208 } 209 210 ioas_put_locked(ioas); 211 out_unlock: 212 mutex_unlock(&ictx->lock); 213 return ret; 214 }; 215 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org