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

From: Joerg Roedel
Date: Thu Apr 28 2022 - 05:49:16 EST


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 devm_platform_get_and_ioremap_resource() to simplify code.
>
> Fixes: 46d1fb072e76 ("iommu/dart: Add DART iommu driver")
> Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx>
> ---
> drivers/iommu/apple-dart.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)

Applied to iommu/fixes, thanks.