[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220809085629.509116-1-daniel.lezcano@linaro.org>
Date: Tue, 9 Aug 2022 10:56:26 +0200
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: daniel.lezcano@...aro.org, rafael@...nel.org
Cc: michael@...le.cc, dan.carpenter@...cle.com, linux@...ck-us.net,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
Amit Kucheria <amitk@...nel.org>,
Zhang Rui <rui.zhang@...el.com>
Subject: [PATCH v2 1/4] thermal/of: Fix error code in of_thermal_zone_find()
From: Dan Carpenter <dan.carpenter@...cle.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@...cle.com>
Link: https://lore.kernel.org/r/YvDzovkMCQecPDjz@kili
Signed-off-by: Daniel Lezcano <daniel.lezcano@...aro.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
Powered by blists - more mailing lists