diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2017-02-15 06:11:22 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-02-15 06:11:22 -0800 |
| commit | 0f23b0a7d014c87006e57797f02b5691e03ea3c4 (patch) | |
| tree | c03e1255c6a96a3f24f0504cc009829c9e8ea161 | |
| parent | 3e0909682d150e61bf01836da913f50fa08f6e1d (diff) | |
| parent | 79b8a6edd3ef9957e9dc0895ddf1b650fd4d5a48 (diff) | |
Merge "msm: camera: sensor: Validate destination step position"
| -rw-r--r-- | drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c | 8 |
1 files changed, 7 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 39811aa84e8e..cd48f871eb79 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-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2017, 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 @@ -528,6 +528,12 @@ static int32_t msm_actuator_piezo_move_focus( return -EFAULT; } + if (dest_step_position > a_ctrl->total_steps) { + pr_err("Step pos greater than total steps = %d\n", + dest_step_position); + return -EFAULT; + } + a_ctrl->i2c_tbl_index = 0; a_ctrl->func_tbl->actuator_parse_i2c_params(a_ctrl, (num_steps * |
