clk: sunxi: sun9i-mmc: check return value after calling platform_get_resource()
authorYang Yingliang <yangyingliang@huawei.com>
Thu, 21 Apr 2022 13:43:08 +0000 (21:43 +0800)
committerJernej Skrabec <jernej.skrabec@gmail.com>
Mon, 25 Apr 2022 17:50:53 +0000 (19:50 +0200)
commitf58ca215cda1975f77b2b762903684a3c101bec9
treeb916c11f5af2831bb5f292ba0d4414b1c6bca6d2
parentb4f3d5f06e29b7020f19cc788b2c2de750e888a1
clk: sunxi: sun9i-mmc: 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: 7a6fca879f59 ("clk: sunxi: Add driver for A80 MMC config clocks/resets")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/r/20220421134308.2885094-1-yangyingliang@huawei.com
drivers/clk/sunxi/clk-sun9i-mmc.c