Commit 360a1028 authored by Wei Yongjun's avatar Wei Yongjun Committed by Georgi Djakov

interconnect: imx: Fix return value check in imx_icc_node_init_qos()

In case of error, the function of_parse_phandle() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Fixes: f0d80485 ("interconnect: Add imx core driver")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
Link: https://lore.kernel.org/r/20200509030214.14435-1-weiyongjun1@huawei.comSigned-off-by: default avatarGeorgi Djakov <georgi.djakov@linaro.org>
parent 4b54bf47
...@@ -90,10 +90,10 @@ static int imx_icc_node_init_qos(struct icc_provider *provider, ...@@ -90,10 +90,10 @@ static int imx_icc_node_init_qos(struct icc_provider *provider,
node->name, node->id); node->name, node->id);
} else { } else {
dn = of_parse_phandle(dev->of_node, adj->phandle_name, 0); dn = of_parse_phandle(dev->of_node, adj->phandle_name, 0);
if (IS_ERR(dn)) { if (!dn) {
dev_warn(dev, "Failed to parse %s: %ld\n", dev_warn(dev, "Failed to parse %s\n",
adj->phandle_name, PTR_ERR(dn)); adj->phandle_name);
return PTR_ERR(dn); return -ENODEV;
} }
/* Allow scaling to be disabled on a per-node basis */ /* Allow scaling to be disabled on a per-node basis */
if (!dn || !of_device_is_available(dn)) { if (!dn || !of_device_is_available(dn)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment