linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/4] thermal/of: Fix error code in of_thermal_zone_find()
@ 2022-08-09  8:56 Daniel Lezcano
  2022-08-09  8:56 ` [PATCH v2 2/4] thermal/of: Return -ENODEV instead of -EINVAL if registration fails Daniel Lezcano
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Daniel Lezcano @ 2022-08-09  8:56 UTC (permalink / raw)
  To: daniel.lezcano, rafael
  Cc: michael, dan.carpenter, linux, linux-kernel, linux-pm,
	Amit Kucheria, Zhang Rui

From: Dan Carpenter <dan.carpenter@oracle.com>

Currently, if we cannot find the correct thermal zone then this error
path returns NULL and it would lead to an Oops in the caller.  Return
ERR_PTR(-EINVAL) instead.

Fixes: 3bd52ac87347 ("thermal/of: Rework the thermal device tree initialization")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YvDzovkMCQecPDjz@kili
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/thermal/thermal_of.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
index c2bb5954b21e..368eb58e97cf 100644
--- a/drivers/thermal/thermal_of.c
+++ b/drivers/thermal/thermal_of.c
@@ -368,6 +368,7 @@ static struct device_node *of_thermal_zone_find(struct device_node *sensor, int
 			}
 		}
 	}
+	tz = ERR_PTR(-EINVAL);
 out:
 	of_node_put(np);
 	return tz;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-08-23 16:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-09  8:56 [PATCH v2 1/4] thermal/of: Fix error code in of_thermal_zone_find() Daniel Lezcano
2022-08-09  8:56 ` [PATCH v2 2/4] thermal/of: Return -ENODEV instead of -EINVAL if registration fails Daniel Lezcano
2022-08-09 14:25   ` Guenter Roeck
2022-08-23 12:43   ` [thermal: thermal/next] " thermal-bot for Daniel Lezcano
2022-08-09  8:56 ` [PATCH v2 3/4] dt-bindings: thermal: Fix missing required property Daniel Lezcano
2022-08-09 20:27   ` Rob Herring
2022-08-15 18:43   ` [thermal: thermal/fixes] " thermal-bot for Daniel Lezcano
2022-08-09  8:56 ` [PATCH v2 4/4] thermal/of: Fix free after use in thermal_of_unregister() Daniel Lezcano
2022-08-09 14:26   ` Guenter Roeck
2022-08-23 12:43   ` [thermal: thermal/next] " thermal-bot for Daniel Lezcano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).