Re: [PATCH v1 2/4] iommu/arm-smmu-v3: Fix fwnode lookup lifetime handling

From: Jason Gunthorpe

Date: Wed Jul 15 2026 - 15:37:44 EST


On Tue, Jul 14, 2026 at 02:09:28PM +0800, weimin xiong wrote:
> bus_find_device_by_fwnode() returns a device with its reference count
> incremented. arm_smmu_get_by_fwnode() drops that reference before
> reading the driver data, which leaves the returned pointer derived from
> a device after its reference has been released.
>
> Read the driver data before put_device() and return NULL directly when
> the lookup fails.
>
> Signed-off-by: weimin xiong <xiongwm2026@xxxxxxx>
> ---
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)

Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>

Jason