summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/thermal_sys.c
diff options
context:
space:
mode:
authorDurgadoss R2011-01-19 22:10:56 +0100
committerLen Brown2011-03-03 01:47:57 +0100
commit4fdfbe8506fa236f3c4cc915b24e70f84a6f768a (patch)
tree4ec9db4d074cf391e5f9e19754b4d09e4291e5f9 /drivers/thermal/thermal_sys.c
parentLinux 2.6.38-rc7 (diff)
downloadkernel-qcow2-linux-4fdfbe8506fa236f3c4cc915b24e70f84a6f768a.tar.gz
kernel-qcow2-linux-4fdfbe8506fa236f3c4cc915b24e70f84a6f768a.tar.xz
kernel-qcow2-linux-4fdfbe8506fa236f3c4cc915b24e70f84a6f768a.zip
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: Durgadoss R <durgadoss.r@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/thermal/thermal_sys.c')
-rw-r--r--drivers/thermal/thermal_sys.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index 713b7ea4a607..fc6f2a5bde01 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -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);