[PATCH] iommu/rockchip: check return value of of_find_device_by_node() in rk_iommu_of_xlate()

yukuai (C) yukuai3 at huawei.com
Thu Oct 29 09:19:05 EDT 2020


On 2020/10/29 18:08, Robin Murphy wrote:
> On 2020-10-29 09:22, Yu Kuai wrote:
>> If of_find_device_by_node() failed in rk_iommu_of_xlate(), null pointer
>> dereference will be triggered. Thus return error code if
>> of_find_device_by_node() failed.
> 
> How can that happen? (Given that ".suppress_bind_attrs = true")
> 
> Robin.

I'm not sure if that could happen...

My thought is that it's better to do such checking to aviod any possible
problem.

Thanks!
Yu Kuai



More information about the Linux-rockchip mailing list