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

Commit fa2c98ac authored by Haseeb Khan's avatar Haseeb Khan Committed by Pulkit Singh Tak
Browse files

msm: cvp: Fix to avoid cache entry for unwanted buffer



Error handle to avoid dereferencing of unwanted buffer during deinit

Change-Id: I0414c18b5a0bba1e1f915c59ba99cce82c0e98fe
Signed-off-by: default avatarHaseeb Khan <hkhan@codeaurora.org>
parent c0a8ba67
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -382,7 +382,11 @@ static struct msm_cvp_smem *msm_cvp_session_get_smem(struct msm_cvp_inst *inst,
		rc = msm_cvp_map_smem(inst, smem, "map cpu");
		if (rc)
			goto exit;

		if (buf->size > smem->size || buf->size > smem->size - buf->offset) {
			dprintk(CVP_ERR, "%s: invalid offset %d or size %d for a new entry\n",
				__func__, buf->offset, buf->size);
			goto exit2;
		}
		rc = msm_cvp_session_add_smem(inst, smem);
		if (rc && rc != -ENOMEM)
			goto exit2;