mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-09-28 19:20:30 +00:00
thermal: Validate new state in cur_state_store()
[ Upstream commitc408b3d1d9] 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> Stable-dep-of:6c54b7bc8a("thermal: core: call put_device() only after device_register() fails") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
3896f78b22
commit
80bb3b901a
4 changed files with 14 additions and 19 deletions
Loading…
Add table
Add a link
Reference in a new issue