Re: [PATCH] iommu/dart: check return value after calling platform_get_resource()

2022-04-28 Thread Joerg Roedel
On Mon, Apr 25, 2022 at 05:08:26PM +0800, Yang Yingliang wrote: > It will cause null-ptr-deref in resource_size(), if platform_get_resource() > returns NULL, move calling resource_size() after devm_ioremap_resource() that > will check 'res' to avoid null-ptr-deref. > And use

Re: [PATCH] iommu/dart: check return value after calling platform_get_resource()

2022-04-26 Thread Sven Peter via iommu
> On 25. Apr 2022, at 10:56, Yang Yingliang wrote: > > It will cause null-ptr-deref in resource_size(), if platform_get_resource() > returns NULL, move calling resource_size() after devm_ioremap_resource() that > will check 'res' to avoid null-ptr-deref. > And use

[PATCH] iommu/dart: check return value after calling platform_get_resource()

2022-04-25 Thread Yang Yingliang via iommu
It will cause null-ptr-deref in resource_size(), if platform_get_resource() returns NULL, move calling resource_size() after devm_ioremap_resource() that will check 'res' to avoid null-ptr-deref. And use devm_platform_get_and_ioremap_resource() to simplify code. Fixes: 46d1fb072e76 ("iommu/dart: