Skip to content

Commit

Permalink
Thermal_Framework-Fix_crash_during_hwmon_unregister
Browse files Browse the repository at this point in the history
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: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Durgadoss R authored and Len Brown committed Mar 3, 2011
1 parent dd9c154 commit 4fdfbe8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/thermal/thermal_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,8 @@ thermal_remove_hwmon_sysfs(struct thermal_zone_device *tz)

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

mutex_lock(&thermal_list_lock);
list_del(&tz->hwmon_node);
Expand Down

0 comments on commit 4fdfbe8

Please sign in to comment.