FPII-2954 :Elevation of privilege vulnerability in Qualcomm video driver CVE-2016-10233: Apply QC-CR#897452

msm-camera: Addressing possible overflow conditions
Changes to address possible integer overflow and incorrect
array indexing conditions.

Change-Id: I51355793cfe3111dd2120839c3ed97681d68dbcb
diff --git a/drivers/media/platform/msm/camera_v2/sensor/io/msm_camera_io_util.c b/drivers/media/platform/msm/camera_v2/sensor/io/msm_camera_io_util.c
index 403bfff..7c65645 100644
--- a/drivers/media/platform/msm/camera_v2/sensor/io/msm_camera_io_util.c
+++ b/drivers/media/platform/msm/camera_v2/sensor/io/msm_camera_io_util.c
@@ -251,6 +251,12 @@
 		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;