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

Commit 91963df6 authored by Sagar Gore's avatar Sagar Gore Committed by Rajakumar Govindaram
Browse files

msm: camera: cpp: Avoid cpp frame access during error



In case cpp frame configuration hits error, cpp frame data
should be cleaned up and invalid output buffer info need not be
communicated to userspace. Added changes to avoid access to
cpp frame data struct in error case.

Change-Id: I6cf620fcd68f5055ff0e6f3d1a12bb468dafecc3
Signed-off-by: default avatarSagar Gore <sgore@codeaurora.org>
parent e0100bc1
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -2859,10 +2859,13 @@ static long msm_cpp_subdev_fops_compat_ioctl(struct file *file,
		/* Configure the cpp frame */
		if (cpp_frame) {
			rc = msm_cpp_cfg_frame(cpp_dev, cpp_frame);
			/* Cpp_frame can be free'd by cfg_frame in error */
			if (rc >= 0) {
				k32_frame_info.output_buffer_info[0] =
					cpp_frame->output_buffer_info[0];
				k32_frame_info.output_buffer_info[1] =
					cpp_frame->output_buffer_info[1];
			}
		} else {
			pr_err("%s: Error getting frame\n", __func__);
			rc = -EINVAL;