CC: kbuild-...@lists.01.org BCC: l...@intel.com CC: linux-ker...@vger.kernel.org TO: Jason Gunthorpe <j...@nvidia.com> CC: Yi Liu <yi.l....@intel.com>
tree: https://github.com/jgunthorpe/linux iommufd head: fc388f906088fe5f5f2db6a36931e00124f52042 commit: 80866de54d68bbcdb9a65b74f93d4eba596a6f3d [3/13] iommufd: File descriptor, context, kconfig and makefiles :::::: branch date: 4 weeks ago :::::: commit date: 4 weeks ago compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0 reproduce (cppcheck warning): # apt-get install cppcheck git checkout 80866de54d68bbcdb9a65b74f93d4eba596a6f3d cppcheck --quiet --enable=style,performance,portability --template=gcc FILE If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <l...@intel.com> cppcheck possible warnings: (new ones prefixed by >>, may not real problems) >> drivers/iommu/iommufd/main.c:171:13: warning: Uninitialized variable: >> obj->type [uninitvar] if (obj->type != cur) ^ -- >> drivers/vfio/pci/vfio_pci_core.c:746:8: warning: Local variable 'cmd' >> shadows outer argument [shadowArgument] u16 cmd; ^ drivers/vfio/pci/vfio_pci_core.c:637:70: note: Shadowed declaration long vfio_pci_core_ioctl(struct vfio_device *core_vdev, unsigned int cmd, ^ drivers/vfio/pci/vfio_pci_core.c:746:8: note: Shadow variable u16 cmd; ^ vim +171 drivers/iommu/iommufd/main.c 80866de54d68bb Jason Gunthorpe 2021-11-11 160 80866de54d68bb Jason Gunthorpe 2021-11-11 161 static int iommufd_fops_release(struct inode *inode, struct file *filp) 80866de54d68bb Jason Gunthorpe 2021-11-11 162 { 80866de54d68bb Jason Gunthorpe 2021-11-11 163 struct iommufd_ctx *ictx = filp->private_data; 80866de54d68bb Jason Gunthorpe 2021-11-11 164 struct iommufd_object *obj; 80866de54d68bb Jason Gunthorpe 2021-11-11 165 unsigned long index = 0; 80866de54d68bb Jason Gunthorpe 2021-11-11 166 int cur = 0; 80866de54d68bb Jason Gunthorpe 2021-11-11 167 80866de54d68bb Jason Gunthorpe 2021-11-11 168 /* Destroy the graph from depth first */ 80866de54d68bb Jason Gunthorpe 2021-11-11 169 while (cur < IOMMUFD_OBJ_MAX) { 80866de54d68bb Jason Gunthorpe 2021-11-11 170 xa_for_each(&ictx->objects, index, obj) { 80866de54d68bb Jason Gunthorpe 2021-11-11 @171 if (obj->type != cur) 80866de54d68bb Jason Gunthorpe 2021-11-11 172 continue; 80866de54d68bb Jason Gunthorpe 2021-11-11 173 xa_erase(&ictx->objects, index); 80866de54d68bb Jason Gunthorpe 2021-11-11 174 if (WARN_ON(!refcount_dec_and_test(&obj->users))) 80866de54d68bb Jason Gunthorpe 2021-11-11 175 continue; 80866de54d68bb Jason Gunthorpe 2021-11-11 176 iommufd_object_ops[obj->type].destroy(obj); 80866de54d68bb Jason Gunthorpe 2021-11-11 177 kfree(obj); 80866de54d68bb Jason Gunthorpe 2021-11-11 178 } 80866de54d68bb Jason Gunthorpe 2021-11-11 179 cur++; 80866de54d68bb Jason Gunthorpe 2021-11-11 180 } 80866de54d68bb Jason Gunthorpe 2021-11-11 181 WARN_ON(!xa_empty(&ictx->objects)); 80866de54d68bb Jason Gunthorpe 2021-11-11 182 kfree(ictx); 80866de54d68bb Jason Gunthorpe 2021-11-11 183 return 0; 80866de54d68bb Jason Gunthorpe 2021-11-11 184 } 80866de54d68bb Jason Gunthorpe 2021-11-11 185 -- 0-DAY CI Kernel Test Service https://01.org/lkp _______________________________________________ kbuild mailing list -- kbuild@lists.01.org To unsubscribe send an email to kbuild-le...@lists.01.org