mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
thermal: Validate new state in cur_state_store()
In cur_state_store(), the new state of the cooling device is received from user-space and is not validated by the thermal core but the same is left for the individual drivers to take care of. Apart from duplicating the code it leaves possibility for introducing bugs where a driver may not do it right. Lets make the thermal core check the new state itself and store the max value in the cooling device structure. Link: https://lore.kernel.org/all/Y0ltRJRjO7AkawvE@kili/ Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
committed by
Rafael J. Wysocki
parent
247f34f7b8
commit
c408b3d1d9
@@ -100,6 +100,7 @@ struct thermal_cooling_device_ops {
|
||||
struct thermal_cooling_device {
|
||||
int id;
|
||||
char *type;
|
||||
unsigned long max_state;
|
||||
struct device device;
|
||||
struct device_node *np;
|
||||
void *devdata;
|
||||
|
Reference in New Issue
Block a user