Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b99d4390 authored by Georgi Hristov's avatar Georgi Hristov
Browse files

msm: camera_v2: cpp: check event queue for NULL



In msm_cpp_subdev_ioctl at VIDIOC_MSM_CPP_GET_EVENTPAYLOAD
check event queue for NULL before dereferencing command field.

CRs-Fixed: 591850
Change-Id: I389cc03305119efc057f183acdda7865358c6c5d
Signed-off-by: default avatarGeorgi Hristov <ghristov@codeaurora.org>
parent 08a831a6
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1691,6 +1691,11 @@ long msm_cpp_subdev_ioctl(struct v4l2_subdev *sd,
		struct msm_cpp_frame_info_t *process_frame;
		CPP_DBG("VIDIOC_MSM_CPP_GET_EVENTPAYLOAD\n");
		event_qcmd = msm_dequeue(queue, list_eventdata);
		if (!event_qcmd) {
			pr_err("no queue cmd available");
			mutex_unlock(&cpp_dev->mutex);
			return -EINVAL;
		}
		process_frame = event_qcmd->command;
		CPP_DBG("fid %d\n", process_frame->frame_id);
		if (copy_to_user((void __user *)ioctl_ptr->ioctl_ptr,