[PATCH 03/10] iommu: Add generic_single_device_group()

Jason Gunthorpe jgg at nvidia.com
Fri Jul 21 10:19:59 PDT 2023


On Thu, Jul 20, 2023 at 10:01:54PM +0800, Baolu Lu wrote:

> Then, another small comment:
> 
> iommu->singleton_group will be freed with above put, right? Do you need
> to set iommu->singleton_group to NULL? Given that iommu_device is not
> freed here.

Well, I think the general API is we expect the caller to free the
iommu_device after calling unregister so this would be like all the
other places we free or put something then go on to release the
memory.

At the very least if the caller thinks it should re-use the
iommu_device then it needs to zero it.

Notice this also doesn't hold the lock while putting it, we require no
concurrent calls to probe with unregister.

Jason




More information about the linux-arm-kernel mailing list