thermal: check array index when set cur_state [1/1]
authorWencai You <wencai.you@amlogic.com>
Thu, 23 May 2019 12:42:51 +0000 (20:42 +0800)
committerNick Xie <nick@khadas.com>
Mon, 5 Aug 2019 06:36:02 +0000 (14:36 +0800)
commit64d179680a9428f3f171497e000c19d4da9799c2
tree257699cd4a993f5c515b412dbc66d4a3afdfc0c9
parentcf5b2408d4ac1f6bc5fb599637578d7d75e6d524
thermal: check array index when set cur_state [1/1]

PD#SWPL-8747

Problem:
android.security.sts.Poc17_11#testPocCVE_2017_6264
test echo /sys/devices/virtual/thermal/cooling_device2/cur_state
crash

Solution:
check array index

Verify:
verified by u212

Change-Id: I235d62508d95fffaed7b811ba008384db7c7ec6f
Signed-off-by: Wencai You <wencai.you@amlogic.com>
drivers/amlogic/thermal/gpu_cooling.c