Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4fdfbe85 authored by Durgadoss R's avatar Durgadoss R Committed by Len Brown
Browse files

Thermal_Framework-Fix_crash_during_hwmon_unregister



This patch fixes the following bug:
The thermal framework creates a temp*_crit interface, only when
the get_crit_temp pointer is defined. But during the _unregister_
path, without checking for the function definition, it is trying to
remove the temp*_crit interface.

Signed-off-by: default avatarDurgadoss R <durgadoss.r@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent dd9c1549
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -560,6 +560,7 @@ thermal_remove_hwmon_sysfs(struct thermal_zone_device *tz)

	tz->hwmon = NULL;
	device_remove_file(hwmon->device, &tz->temp_input.attr);
	if (tz->ops->get_crit_temp)
		device_remove_file(hwmon->device, &tz->temp_crit.attr);

	mutex_lock(&thermal_list_lock);