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>
Wed, 21 Feb 2018 17:42:51 +0000 (09:42 -0800)
commit5a2407e166a86148c4b60c52fc639c6dde0652bf
tree546da85a95b584146b7befa27c87daf442214ac8
parent3c70fc7ffc95a7499e2f04cbce3468076be45b78
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/1630002
Reviewed-on: https://git-master.nvidia.com/r/1661413
GVS: Gerrit_Virtual_Submit
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Tested-by: Amulya Yarlagadda <ayarlagadda@nvidia.com>
drivers/thermal/thermal_core.c