summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManish Poddar <mpoddar@codeaurora.org>2016-03-23 16:57:23 +0530
committerKrishnankutty Kolathappilly <kkolatha@codeaurora.org>2016-12-12 23:45:53 -0800
commitfaef6bbca74dcfe02e0840777c8f6b3806041227 (patch)
tree10eaa0eda4cd50b99a8fc446b4501c4b033769e5
parent95db044dafc2c65640a3e26b3a48cb632c750b8c (diff)
msm: camera: Initialize variables to default
Add NULL check and initialize the variables to default values in camera. CRs-fixed: 994317 Change-Id: I165f1c39c1332737a644c6650bc40f4c718a7ee8 Signed-off-by: Manish Poddar <mpoddar@codeaurora.org>
-rw-r--r--drivers/media/platform/msm/camera_v2/common/cam_smmu_api.c5
-rw-r--r--drivers/media/platform/msm/camera_v2/fd/msm_fd_dev.c2
-rw-r--r--drivers/media/platform/msm/camera_v2/fd/msm_fd_hw.c2
3 files changed, 7 insertions, 2 deletions
diff --git a/drivers/media/platform/msm/camera_v2/common/cam_smmu_api.c b/drivers/media/platform/msm/camera_v2/common/cam_smmu_api.c
index 3e3143be0a13..b045d6c6e8da 100644
--- a/drivers/media/platform/msm/camera_v2/common/cam_smmu_api.c
+++ b/drivers/media/platform/msm/camera_v2/common/cam_smmu_api.c
@@ -972,6 +972,11 @@ static int cam_smmu_map_buffer_and_add_to_list(int idx, int ion_fd,
struct dma_buf_attachment *attach = NULL;
struct sg_table *table = NULL;
+ if (!paddr_ptr) {
+ rc = -EINVAL;
+ goto err_out;
+ }
+
/* allocate memory for each buffer information */
buf = dma_buf_get(ion_fd);
if (IS_ERR_OR_NULL(buf)) {
diff --git a/drivers/media/platform/msm/camera_v2/fd/msm_fd_dev.c b/drivers/media/platform/msm/camera_v2/fd/msm_fd_dev.c
index 1cfb7a3dfa00..4deda8da3871 100644
--- a/drivers/media/platform/msm/camera_v2/fd/msm_fd_dev.c
+++ b/drivers/media/platform/msm/camera_v2/fd/msm_fd_dev.c
@@ -540,7 +540,7 @@ static long msm_fd_private_ioctl(struct file *file, void *fh,
struct fd_ctx *ctx = msm_fd_ctx_from_fh(fh);
struct msm_fd_stats *stats;
int stats_idx;
- int ret;
+ int ret = -EINVAL;
int i;
switch (cmd) {
diff --git a/drivers/media/platform/msm/camera_v2/fd/msm_fd_hw.c b/drivers/media/platform/msm/camera_v2/fd/msm_fd_hw.c
index 760a59d15a31..21d42a77accb 100644
--- a/drivers/media/platform/msm/camera_v2/fd/msm_fd_hw.c
+++ b/drivers/media/platform/msm/camera_v2/fd/msm_fd_hw.c
@@ -965,7 +965,7 @@ void msm_fd_hw_put(struct msm_fd_device *fd)
*/
static int msm_fd_hw_attach_iommu(struct msm_fd_device *fd)
{
- int ret;
+ int ret = -EINVAL;
mutex_lock(&fd->lock);