drivers: thermal: validate cdev sysfs state request before using it
There is a chance that userspace cooling device cur_state or
min_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 or min_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: If6422327b2bf4235617203588a5fe5805bf918f2
Signed-off-by:
Gopala Krishna Nuthaki <quic_gnuthaki@quicinc.com>
Loading
Please register or sign in to comment