On Tue, Sep 27, 2022 at 02:34:43PM +0800, Yi Liu wrote: > > @@ -137,7 +135,7 @@ __vfio_group_get_from_iommu(struct iommu_group *iommu_group) > > list_for_each_entry(group, &vfio.group_list, vfio_next) { > > if (group->iommu_group == iommu_group) { > > - vfio_group_get(group); > > + refcount_inc(&group->drivers); > > so the __vfio_group_get_from_iommu() can only be used in the vfio device > registration path. right? If used by other path, then group->drivers cnt > is not correct. Yes, thats right - more specifically vfio_device_remove_group() has to pair with the two allocation functions. Jason