diff options
| author | Guenter Roeck <linux@roeck-us.net> | 2026-10-29 23:34:04 -0700 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2026-11-02 07:00:05 -0800 |
| commit | 11dfbd835b17b75f7cc7a4a969f33ff702b1b081 (patch) | |
| tree | fe0082196c5aeb37bd1bcfc48f75637745ba7ebb /scripts/const_structs.checkpatch | |
| parent | a5802c587da97a4ff85c04aad6043fa26640fc9b (diff) | |
hwmon: (pmbus) Check return value from pmbus_thermal_add_sensor()
During PMBus device probe, if registering a temperature sensor with the
thermal subsystem fails, pmbus_add_sensor() silently ignores the error and
returns success.
When a valid temperature sensor is detected (class PSC_TEMPERATURE and type
"input"), pmbus_add_sensor() invokes pmbus_thermal_add_sensor() to hook it
into the kernel's thermal framework. However, the return value of this call
is completely discarded. If thermal registration fails, such as from an
-ENOMEM allocation failure or an invalid device tree configuration like a
malformed #thermal-sensor-cells property, no error is propagated.
Because the hardware monitor probe falsely succeeds despite the failure to
register the thermal zone, the system is left without thermal mitigation
for the affected PMBus device. This silently blinds the system to actual
PMIC temperatures, preventing the execution of necessary cooling mechanisms
or emergency shutdowns and risking localized overheating.
Pass the return value from pmbus_thermal_add_sensor() to the calling code
to fix the problem. To enable passing the actual error, change the error
return from pmbus_add_sensor() from NULL to ERR_PTR() and extract the error
from in the calling code.
Fixes: 3aa74796cfd0 ("hwmon: (pmbus) Register with thermal for PSC_TEMPERATURE")
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'scripts/const_structs.checkpatch')
0 files changed, 0 insertions, 0 deletions
