Skip to content

Commit 192fa93

Browse files
authored
Merge pull request #4 from ubports/fix-camera-crash
Fix null pointer access inside msm camera
2 parents 5f96723 + 9e23c81 commit 192fa93

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/media/platform/msm/camera_v1/msm_mctl.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,8 +878,17 @@ static int msm_mctl_dev_close(struct file *f)
878878
struct msm_cam_v4l2_device *pcam;
879879
struct msm_cam_v4l2_dev_inst *pcam_inst;
880880
struct msm_cam_media_controller *pmctl;
881+
882+
if (f == NULL) {
883+
pr_err("%s :: cannot close video driver", __func__);
884+
return -EINVAL;
885+
}
881886
pcam_inst = container_of(f->private_data,
882887
struct msm_cam_v4l2_dev_inst, eventHandle);
888+
if (!pcam_inst) {
889+
pr_err("%s NULL pointer of container!\n", __func__);
890+
return -EINVAL;
891+
}
883892
pcam = pcam_inst->pcam;
884893

885894
D("%s : E ", __func__);

0 commit comments

Comments
 (0)