On 2023/7/22 1:19, Jason Gunthorpe wrote:
On Thu, Jul 20, 2023 at 10:01:54PM +0800, Baolu Lu wrote:
quoted
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.
Fair enough. Thanks for the explanation.
Best regards,
baolu
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel