]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 May 2022 10:20:22 +0000 (12:20 +0200)
commitf495a90ccfa2968d1b559b110ff3455c29f3535e
tree4e69027acccd554aa8434db6224d9261299755da
parentc95d4bf1c779e70164d3fc24e78300028578f3db
clk: sunxi: sun9i-mmc: check return value after calling platform_get_resource()

[ Upstream commit f58ca215cda1975f77b2b762903684a3c101bec9 ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/sunxi/clk-sun9i-mmc.c