drivers: thermal: validate cdev sysfs cur_state request before using it
There is a chance that userspace cooling device cur_state sysfs node
can request any random value. It may be a value greater than
max supported state. In that case if cooling device is not
bailing out, cooling device stats module may behave unexpectedly.
Validate whether cur_state request is within the range of max
supported state or not for each cooling device. If it is greater than
max_state, bail out for that request for different cooling devices.
Change-Id: Iaa6216ad1d2f1e5b92469cd3904715dd6c0b940c
Signed-off-by:
Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Loading
Please register or sign in to comment