Skip to content

Commit 4eb7c2f

Browse files
zhang-ruirafaeljw
authored andcommitted
thermal: thermal_hwmon: Fix a kernel NULL pointer dereference
When the hwmon device node of a thermal zone device is not found, using hwmon->device causes a kernel NULL pointer dereference. Fixes: dec07d3 ("thermal: Don't use 'device' internal thermal zone structure field") Reported-by: Preble Adam C <adam.c.preble@intel.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 85b5212 commit 4eb7c2f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/thermal/thermal_hwmon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ void thermal_remove_hwmon_sysfs(struct thermal_zone_device *tz)
229229
hwmon = thermal_hwmon_lookup_by_type(tz);
230230
if (unlikely(!hwmon)) {
231231
/* Should never happen... */
232-
dev_dbg(hwmon->device, "hwmon device lookup failed!\n");
232+
dev_dbg(&tz->device, "hwmon device lookup failed!\n");
233233
return;
234234
}
235235

0 commit comments

Comments
 (0)