summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2018-02-09 08:25:36 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2018-02-09 08:25:36 -0800
commit5e5f1941b4e7b48b5691bcf65972cff01d5342e1 (patch)
tree66ada2554b441abbb9c5a4c78527976f157cc423
parent5072ad3bd59d4d1e878f6a6b2799893185be1a7e (diff)
parent9de2b620dc3055774a454216a017858b9d54062b (diff)
Merge "msm: ais: sensor: Fix out of bound read for region params"
-rw-r--r--drivers/media/platform/msm/ais/sensor/actuator/msm_actuator.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/platform/msm/ais/sensor/actuator/msm_actuator.c b/drivers/media/platform/msm/ais/sensor/actuator/msm_actuator.c
index 260c1dc3e963..4a23fe0e9c7e 100644
--- a/drivers/media/platform/msm/ais/sensor/actuator/msm_actuator.c
+++ b/drivers/media/platform/msm/ais/sensor/actuator/msm_actuator.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2011-2018, 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
@@ -646,6 +646,8 @@ static int32_t msm_actuator_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];