diff options
| author | guyang <guyang@codeaurora.org> | 2016-12-09 19:05:24 +0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-12-09 03:19:11 -0800 |
| commit | 0cd36b78f9ec35e80e16253c8aba2f76bb474da9 (patch) | |
| tree | fb11b4230613d82a1813c96e96ea5b69f6bead62 | |
| parent | 368fecd7df5b203a5ce684a0c77726a5690c1147 (diff) | |
msm-camera: Addressing possible overflow conditions
Changes to address possible integer overflow and incorrect
array indexing conditions.
Change-Id: Ib134320cd6f7b34d7a10572ec347ec12127049a9
Signed-off-by: Trilokesh Rangam <tranga@codeaurora.org>
Signed-off-by: Yang Guang <guyang@codeaurora.org>
| -rw-r--r-- | drivers/media/platform/msm/camera_v2/common/msm_camera_io_util.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/platform/msm/camera_v2/common/msm_camera_io_util.c b/drivers/media/platform/msm/camera_v2/common/msm_camera_io_util.c index 6f438d59b30b..c243d587e308 100644 --- a/drivers/media/platform/msm/camera_v2/common/msm_camera_io_util.c +++ b/drivers/media/platform/msm/camera_v2/common/msm_camera_io_util.c @@ -394,6 +394,12 @@ int msm_camera_config_vreg(struct device *dev, struct camera_vreg_t *cam_vreg, pr_err("%s:%d vreg sequence invalid\n", __func__, __LINE__); return -EINVAL; } + + if (cam_vreg == NULL) { + pr_err("%s:%d cam_vreg sequence invalid\n", __func__, __LINE__); + return -EINVAL; + } + if (!num_vreg_seq) num_vreg_seq = num_vreg; |
