iommu/mediatek: Check return value after calling platform_get_resource()
authorYang Yingliang <yangyingliang@huawei.com>
Sat, 29 Oct 2022 10:35:50 +0000 (18:35 +0800)
committerJoerg Roedel <jroedel@suse.de>
Sat, 19 Nov 2022 09:08:49 +0000 (10:08 +0100)
commit73b6924cdebc899de9b719e1319aa86c6bed4acf
treebcddab849eea92656f9c7abc46573c9592609e01
parent30a0b95b1335e12efef89dd78518ed3e4a71a763
iommu/mediatek: Check return value after calling platform_get_resource()

platform_get_resource() may return NULL pointer, we need check its
return value to avoid null-ptr-deref in resource_size().

Fixes: 42d57fc58aeb ("iommu/mediatek: Initialise/Remove for multi bank dev")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Link: https://lore.kernel.org/r/20221029103550.3774365-1-yangyingliang@huawei.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/mtk_iommu.c