summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2019-07-09 00:40:00 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2019-07-09 00:39:59 -0700
commit8f672181451ff8be47e6a2a66a684be121460dbf (patch)
tree6b975423ffdc3027b735c5d6eb2aa1d96e75d3b1
parent1e577bde0fd80fee03fb5556fd4055d90d7b82a6 (diff)
parent1656e2e44ddae9abd52419113d9ab5eb5a10cbc3 (diff)
Merge "msm: sensor: actuator: fix out of bound read for bivcm region params"
-rw-r--r--drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c b/drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c
index 6d60aabae6a5..c80f8159220d 100644
--- a/drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c
+++ b/drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011-2018, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2011-2019, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -768,6 +768,9 @@ static int32_t msm_actuator_bivcm_move_focus(
a_ctrl->curr_step_pos, dest_step_pos, curr_lens_pos);
while (a_ctrl->curr_step_pos != dest_step_pos) {
+ if (a_ctrl->curr_region_index >= a_ctrl->region_size)
+ break;
+
step_boundary =
a_ctrl->region_params[a_ctrl->curr_region_index].
step_bound[dir];