diff options
author | Guenter Roeck <linux@roeck-us.net> | 2022-11-10 07:24:58 -0800 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2022-11-14 19:04:37 +0100 |
commit | 05eeee2b51b44c7ba5f1b8e5c41362020513f163 (patch) | |
tree | db5f9529216677a28b1fc3af6f49f2eb9f483891 /drivers/thermal/thermal_core.h | |
parent | ea37bec51ff442546e4a57d5cca2de9cc64a9df3 (diff) | |
download | linux-05eeee2b51b44c7ba5f1b8e5c41362020513f163.tar.bz2 |
thermal/core: Protect sysfs accesses to thermal operations with thermal zone mutex
Protect access to thermal operations against thermal zone removal by
acquiring the thermal zone device mutex. After acquiring the mutex, check
if the thermal zone device is registered and abort the operation if not.
With this change, we can call __thermal_zone_device_update() instead of
thermal_zone_device_update() from trip_point_temp_store() and from
emul_temp_store(). Similar, we can call __thermal_zone_set_trips() instead
of thermal_zone_set_trips() from trip_point_hyst_store().
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/thermal/thermal_core.h')
-rw-r--r-- | drivers/thermal/thermal_core.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h index 1571917bd3c8..7b51b9a22e7e 100644 --- a/drivers/thermal/thermal_core.h +++ b/drivers/thermal/thermal_core.h @@ -109,6 +109,8 @@ int thermal_register_governor(struct thermal_governor *); void thermal_unregister_governor(struct thermal_governor *); int thermal_zone_device_set_policy(struct thermal_zone_device *, char *); int thermal_build_list_of_policies(char *buf); +void __thermal_zone_device_update(struct thermal_zone_device *tz, + enum thermal_notify_event event); /* Helpers */ void thermal_zone_set_trips(struct thermal_zone_device *tz); |