summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2022-10-17 13:03:01 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-02-01 10:34:26 +0300
commit80bb3b901abe6560620505e5c734d140c4f73a07 (patch)
tree4f7b577d0be00d49c9eb7046f7133dc09f5a4f6b /init
parent3896f78b220378a4557f08d8f9c58788afb33d2f (diff)
downloadlinux-80bb3b901abe6560620505e5c734d140c4f73a07.tar.xz
thermal: Validate new state in cur_state_store()
[ Upstream commit c408b3d1d9bbc7de5fb0304fea424ef2539da616 ] 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: 6c54b7bc8a31 ("thermal: core: call put_device() only after device_register() fails") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'init')
0 files changed, 0 insertions, 0 deletions