RE: [PATCH v4 9/9] vfio/pci: Allow passing zero-length fd array in VFIO_DEVICE_PCI_HOT_RESET

Liu, Yi L
2023-04-27T07:02:40Z

> From: Tian, Kevin <kevin.tian@intel.com>
> Sent: Thursday, April 27, 2023 2:54 PM
>
> > From: Liu, Yi L <yi.l.liu@intel.com>
> > Sent: Wednesday, April 26, 2023 10:54 PM
> >
> > +static bool vfio_dev_in_iommufd_ctx(struct vfio_pci_core_device *vdev,
> > + struct iommufd_ctx *iommufd_ctx)
> > +{
> > + struct iommufd_ctx *iommufd = vfio_iommufd_physical_ictx(&vdev-
> > >vdev);
> > + struct iommu_group *iommu_group;
> > +
> > + if (!iommufd_ctx)
> > + return false;
> > +
> > + if (iommufd == iommufd_ctx)
> > + return true;
> > +
> > + iommu_group = iommu_group_get(vdev->vdev.dev);
> > + if (!iommu_group)
> > + return false;
> > +
> > + /*
> > + * Try to check if any device within iommu_group is bound with
> > + * the input iommufd_ctx.
> > + */
> > + return vfio_devset_iommufd_has_group(vdev->vdev.dev_set,
> > + iommufd_ctx, iommu_group);
>
> iommu_group is not put.

Oops. Yes.