mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2026-01-06 22:46:35 +00:00
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>
This commit is contained in:
parent
3fd6d6e2b4
commit
45b8850b3d
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user