Skip to content

Commit

Permalink
Fix null pointer access inside msm camera
Browse files Browse the repository at this point in the history
Change-Id: I29f3f200d7c7760c1cdd50f95973a3729d6f8380
  • Loading branch information
APokorny committed Oct 6, 2018
1 parent 5f96723 commit 9e23c81
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/media/platform/msm/camera_v1/msm_mctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -878,8 +878,17 @@ static int msm_mctl_dev_close(struct file *f)
struct msm_cam_v4l2_device *pcam;
struct msm_cam_v4l2_dev_inst *pcam_inst;
struct msm_cam_media_controller *pmctl;

if (f == NULL) {
pr_err("%s :: cannot close video driver", __func__);
return -EINVAL;
}
pcam_inst = container_of(f->private_data,
struct msm_cam_v4l2_dev_inst, eventHandle);
if (!pcam_inst) {
pr_err("%s NULL pointer of container!\n", __func__);
return -EINVAL;
}
pcam = pcam_inst->pcam;

D("%s : E ", __func__);
Expand Down

0 comments on commit 9e23c81

Please sign in to comment.