]> Git Repo - linux.git/commitdiff
Thermal_Framework-Fix_crash_during_hwmon_unregister
authorDurgadoss R <[email protected]>
Wed, 19 Jan 2011 21:10:56 +0000 (02:40 +0530)
committerLen Brown <[email protected]>
Thu, 3 Mar 2011 00:47:57 +0000 (19:47 -0500)
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 <[email protected]>
Signed-off-by: Len Brown <[email protected]>
drivers/thermal/thermal_sys.c

index 713b7ea4a60709e89e164fd4765e75e5397ed57f..fc6f2a5bde01324675424b01da941e8718ccd259 100644 (file)
@@ -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);
This page took 0.058452 seconds and 4 git commands to generate.