diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2022-08-09 11:56:26 +0300 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2022-08-17 15:09:37 +0300 |
commit | 45b8850b3d3071d5ea9e19ad4a29ad5f0b5d1ec1 (patch) | |
tree | f74dff2a86884e69e37b1e684ebad214acd68a60 /drivers | |
parent | 3fd6d6e2b4e80fe45bfd1c8f01dff7d30a0f9b53 (diff) | |
download | linux-45b8850b3d3071d5ea9e19ad4a29ad5f0b5d1ec1.tar.xz |
thermal/of: Fix error code in of_thermal_zone_find()
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/thermal/thermal_of.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index 82236fec7c65..15b342fa81d6 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -1102,6 +1102,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; |