reset: uniphier-glue: Fix possible null-ptr-deref
authorHui Tang <tanghui20@huawei.com>
Mon, 14 Nov 2022 00:49:58 +0000 (08:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Feb 2023 07:27:04 +0000 (08:27 +0100)
commit95de286200b2a046da01c4aeba02ae9220d68ca4
tree3603379dbb3f0cce455fcc2f2c6fed299c86c38d
parent4773a8cf9a53878e799ebd78f48e2296b8f02dfd
reset: uniphier-glue: Fix possible null-ptr-deref

[ Upstream commit 3a2390c6777e3f6662980c6cfc25cafe9e4fef98 ]

It will cause null-ptr-deref when resource_size(res) invoked,
if platform_get_resource() returns NULL.

Fixes: 499fef09a323 ("reset: uniphier: add USB3 core reset control")
Signed-off-by: Hui Tang <tanghui20@huawei.com>
Reviewed-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Link: https://lore.kernel.org/r/20221114004958.258513-1-tanghui20@huawei.com
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/reset/reset-uniphier-glue.c