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)
committerJianxin Pan <jianxin.pan@amlogic.com>
Fri, 24 May 2019 04:40:17 +0000 (21:40 -0700)
commitc8803eb79c4f1a6b91befba794f6d3ce32ea1b67
tree8aa19dfa3aa352cfacf76d6261d6f8e82441ae28
parent17cdaf36e852384cef822c87d5d2636c78f2eeac
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