Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 9903e41a authored by Wei Yongjun's avatar Wei Yongjun Committed by Stephen Boyd
Browse files

clk: hisilicon: hi3660:Fix potential NULL dereference in hi3660_stub_clk_probe()



platform_get_resource() may return NULL, add proper check to
avoid potential NULL dereferencing.

This is detected by Coccinelle semantic patch.

@@
expression pdev, res, n, t, e, e1, e2;
@@

res = platform_get_resource(pdev, t, n);
+ if (!res)
+   return -EINVAL;
... when != res == NULL
e = devm_ioremap(e1, res->start, e2);

Fixes: 4f16f7ff ("clk: hisilicon: Add support for Hi3660 stub clocks")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 56e1ee35
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment