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

Commit db1e19be authored by Yu SI's avatar Yu SI
Browse files

msm: cvp:fix potential null ptr dereference msghdr



fix potential null ptr dereference on cvp_hfi_msg_session_hdr
ptr hdr if out is NULL.

Change-Id: Ic2c35ddc4438312cb03f0f346e27d0c0b631b95a
Signed-off-by: default avatarYu SI <ysi@codeaurora.org>
parent 927d34f7
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -111,9 +111,12 @@ static int cvp_wait_process_message(struct msm_cvp_inst *inst,
		goto exit;
	}

	if (out)
		memcpy(out, &msg->pkt, sizeof(struct cvp_hfi_msg_session_hdr));
	if (!out) {
		kmem_cache_free(cvp_driver->msg_cache, msg);
		goto exit;
	}

	memcpy(out, &msg->pkt, sizeof(struct cvp_hfi_msg_session_hdr));
	kmem_cache_free(cvp_driver->msg_cache, msg);
	hdr = (struct cvp_hfi_msg_session_hdr *)out;
	msm_cvp_unmap_frame(inst, hdr->client_data.kdata);