summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);