Commit 683c0d0
Herton R. Krzesinski
Merge: hwmon: Handle failure to register sensor with thermal zone correctly
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/1665
If devm_thermal_zone_of_sensor_register() returns -ENODEV,
report that the sensor was not attached to a thermal zone
but continue to register the hwmon device.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2122394
Upstream Status: git@gitlab.com:redhat/centos-stream/src/kernel/centos-stream-9.git
Signed-off-by: David Marlin <dmarlin@redhat.com>
## Scratch Brew build
https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=49249631
## Description
If an attempt is made to a sensor with a thermal zone and it fails,
the call to devm_thermal_zone_of_sensor_register() may return -ENODEV.
This can result in a crash (NULL pointer dereference).
The hwmon core needs to handle all errors returned from calls
to devm_thermal_zone_of_sensor_register(). If the call fails
with -ENODEV, report that the sensor was not attached to a
thermal zone but continue to register the hwmon device.
Approved-by: Mark Langsdorf <mlangsdo@redhat.com>
Approved-by: Dean Nelson <dnelson@redhat.com>
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>1 file changed
+8
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
223 | 225 | | |
224 | 226 | | |
225 | 227 | | |
| |||
0 commit comments