rtc: mt6397: check return value after calling platform_get_resource()
authorYang Yingliang <yangyingliang@huawei.com>
Thu, 5 May 2022 12:50:43 +0000 (20:50 +0800)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 19 May 2022 10:05:48 +0000 (12:05 +0200)
commitd3b43eb505bffb8e4cdf6800c15660c001553fe6
tree255ab1ff29940c40a29ca1edfecea26e94d299b0
parente60e8a73235ce5d42a2891c6989e8df1c8888c4a
rtc: mt6397: check return value after calling platform_get_resource()

It will cause null-ptr-deref if platform_get_resource() returns NULL,
we need check the return value.

Fixes: fc2979118f3f ("rtc: mediatek: Add MT6397 RTC driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220505125043.1594771-1-yangyingliang@huawei.com
drivers/rtc/rtc-mt6397.c