Wei Yongjun 48504619a6 clk: imx: fix potential NULL dereference in imx8qxp_lpcg_clk_probe()
platform_get_resource() may fail and return NULL, so we should
better check it's return value to avoid a NULL pointer dereference
a bit later in the code.

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: 1e3121bfe51a ("clk: imx: add imx8qxp lpcg driver")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
2019-01-09 10:34:54 -08:00
..
2017-11-01 23:25:49 -07:00
2018-10-17 11:15:32 -07:00
2018-10-17 11:15:20 -07:00
2015-07-20 10:52:49 -07:00
2015-07-20 10:52:49 -07:00
2018-12-03 11:31:32 -08:00
2018-12-03 11:31:28 -08:00
2018-12-03 10:13:35 -08:00
2018-12-13 22:15:49 -08:00
2018-12-14 13:00:51 -08:00
2017-08-30 22:30:27 -07:00