thermal: add boundary check to set_cur_state
authorSrikar Srimath Tirumala <srikars@nvidia.com>
Tue, 12 Sep 2017 19:27:13 +0000 (12:27 -0700)
committerWinnie Hsu <whsu@nvidia.com>
Tue, 27 Feb 2018 00:33:47 +0000 (16:33 -0800)
commit370b9f7a1dad9ccb7198bb0ffd30a8e7df112ab2
tree06df6901c5a2d475830f1e9ea1daade2033bc766
parenta7e55a39cdd16f8170136f7ca18eb89bee20e885
thermal: add boundary check to set_cur_state

Prevent sysfs from setting a cur_state that exceeds the max cur_state
of the cooling device.

Bug 200334223
Bug 200331706
Bug 1968660
Bug 1968616

Change-Id: I935be6166a9e184683abfcdce70cb08cbe4a1350
Signed-off-by: Srikar Srimath Tirumala <srikars@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1558407
(cherry picked from commit 142cf9d96ed221124ea2b778dc37cf5db8d5702c)
Reviewed-on: https://git-master.nvidia.com/r/1661413
Reviewed-on: https://git-master.nvidia.com/r/1662626
GVS: Gerrit_Virtual_Submit
Tested-by: Amulya Yarlagadda <ayarlagadda@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
drivers/thermal/thermal_core.c