[PATCH -next] interconnect: imx: Fix return value check in imx_icc_node_init_qos()

Subsystems: interconnect api, the rest

STALE2287d LANDED

Landed in mainline as 360a10285e7e on 2020-05-10.

3 messages, 3 authors, 2020-05-11 · open the first message on its own page

[PATCH -next] interconnect: imx: Fix return value check in imx_icc_node_init_qos()

From: Wei Yongjun <hidden>
Date: 2020-05-09 02:58:43

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: f0d8048525d7 ("interconnect: Add imx core driver")
Reported-by: Hulk Robot <redacted>
Signed-off-by: Wei Yongjun <redacted>
---
 drivers/interconnect/imx/imx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/interconnect/imx/imx.c b/drivers/interconnect/imx/imx.c
index 6884212511f0..ac420f86008e 100644
--- a/drivers/interconnect/imx/imx.c
+++ b/drivers/interconnect/imx/imx.c
@@ -90,10 +90,10 @@ static int imx_icc_node_init_qos(struct icc_provider *provider,
 			node->name, node->id);
 	} else {
 		dn = of_parse_phandle(dev->of_node, adj->phandle_name, 0);
-		if (IS_ERR(dn)) {
-			dev_warn(dev, "Failed to parse %s: %ld\n",
-				 adj->phandle_name, PTR_ERR(dn));
-			return PTR_ERR(dn);
+		if (!dn) {
+			dev_warn(dev, "Failed to parse %s\n",
+				 adj->phandle_name);
+			return -ENODEV;
 		}
 		/* Allow scaling to be disabled on a per-node basis */
 		if (!dn || !of_device_is_available(dn)) {



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

RE: [PATCH -next] interconnect: imx: Fix return value check in imx_icc_node_init_qos()

From: Aisheng Dong <aisheng.dong@nxp.com>
Date: 2020-05-09 03:51:29

From: Wei Yongjun <redacted>
Sent: Saturday, May 9, 2020 11:02 AM

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: f0d8048525d7 ("interconnect: Add imx core driver")
Reported-by: Hulk Robot <redacted>
Signed-off-by: Wei Yongjun <redacted>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>

Regards
Aisheng
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Re: [PATCH -next] interconnect: imx: Fix return value check in imx_icc_node_init_qos()

From: Leonard Crestez <hidden>
Date: 2020-05-11 13:20:40

On 2020-05-09 5:58 AM, Wei Yongjun wrote:
quoted hunk
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: f0d8048525d7 ("interconnect: Add imx core driver")
Reported-by: Hulk Robot <redacted>
Signed-off-by: Wei Yongjun <redacted>
---
  drivers/interconnect/imx/imx.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/interconnect/imx/imx.c b/drivers/interconnect/imx/imx.c
index 6884212511f0..ac420f86008e 100644
--- a/drivers/interconnect/imx/imx.c
+++ b/drivers/interconnect/imx/imx.c
@@ -90,10 +90,10 @@ static int imx_icc_node_init_qos(struct icc_provider *provider,
  			node->name, node->id);
  	} else {
  		dn = of_parse_phandle(dev->of_node, adj->phandle_name, 0);
-		if (IS_ERR(dn)) {
-			dev_warn(dev, "Failed to parse %s: %ld\n",
-				 adj->phandle_name, PTR_ERR(dn));
-			return PTR_ERR(dn);
+		if (!dn) {
+			dev_warn(dev, "Failed to parse %s\n",
+				 adj->phandle_name);
+			return -ENODEV;
  		}
  		/* Allow scaling to be disabled on a per-node basis */
  		if (!dn || !of_device_is_available(dn)) {
Reviewed-by: Leonard Crestez <redacted>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help