From 0cd36b78f9ec35e80e16253c8aba2f76bb474da9 Mon Sep 17 00:00:00 2001 From: guyang Date: Fri, 9 Dec 2016 19:05:24 +0800 Subject: [PATCH] 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 Signed-off-by: Yang Guang --- .../platform/msm/camera_v2/common/msm_camera_io_util.c | 6 ++++++ 1 file changed, 6 insertions(+) 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;