]> git.baikalelectronics.ru Git - kernel.git/commit
thermal/int340x_thermal: Prevent page fault on .set_mode() op
authorBartosz Szczepanek <bsz@semihalf.com>
Wed, 8 Jul 2020 13:46:13 +0000 (15:46 +0200)
committerZhang Rui <rui.zhang@intel.com>
Tue, 14 Jul 2020 14:46:44 +0000 (22:46 +0800)
commitf4856b10f22de9c5f56c1e7663ac725da4426460
treecddedab9447086d97122e399055ad3be831104e9
parent88732dd384b9767583d52f7ebc7696d1966fdb10
thermal/int340x_thermal: Prevent page fault on .set_mode() op

Starting from commit "thermal/int340x_thermal: Don't require IDSP to
exist", priv->current_uuid_index is initialized to -1. This value may
be passed to int3400_thermal_run_osc() from int3400_thermal_set_mode,
contributing to page fault when accessing int3400_thermal_uuids array
at index -1.

This commit adds a check on uuid value to int3400_thermal_run_osc.

Fixes: 2aeab4a8d383 ("thermal/int340x_thermal: Don't require IDSP to exist")
Signed-off-by: Bartosz Szczepanek <bsz@semihalf.com>
Reviewed-by: Pandruvada, Srinivas <srinivas.pandruvada@linux.intel.com>
[ rzhang: Add Fixes tag ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Link: https://lore.kernel.org/r/20200708134613.131555-1-bsz@semihalf.com
drivers/thermal/intel/int340x_thermal/int3400_thermal.c