]> git.baikalelectronics.ru Git - kernel.git/commit
thermal: mtk: Allocate enough space for mtk_thermal.
authorPi-Hsun Shih <pihsun@chromium.org>
Wed, 9 Jan 2019 05:57:24 +0000 (13:57 +0800)
committerZhang Rui <rui.zhang@intel.com>
Mon, 18 Mar 2019 14:23:10 +0000 (22:23 +0800)
commit0a1be8c1d71d15e23865d9a1115b50cd20dd65dc
tree23f0b348fcd921c8b6797163082aaeb922b3a38a
parentb8058eef66208ff34499c914a34b3a0ed1aeb414
thermal: mtk: Allocate enough space for mtk_thermal.

The mtk_thermal struct contains a 'struct mtk_thermal_bank banks[];',
but the allocation only allocates sizeof(struct mtk_thermal) bytes,
which cause out of bound access with the ->banks[] member. Change it to
a fixed size array instead.

Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org>
Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
drivers/thermal/mtk_thermal.c