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

Commit 34b95595 authored by Ofir Cohen's avatar Ofir Cohen Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: spcom: validate rx_buf in spcom_rx before usage



Checking for rx_buf validity before performing copy operation.

Change-Id: I4651a8cc822fd1537bd92f01bf59ac3b5a500b3a
Signed-off-by: default avatarOfir Cohen <ofirc@codeaurora.org>
parent 7f0d77b3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -898,12 +898,12 @@ static int spcom_rx(struct spcom_channel *ch,
		goto exit_err;
	}

copy_buf:
	if (!ch->glink_rx_buf) {
		pr_err("invalid glink_rx_buf.\n");
		goto exit_err;
	}

copy_buf:
	/* Copy from glink buffer to spcom buffer */
	size = min_t(int, ch->actual_rx_size, size);
	memcpy(buf, ch->glink_rx_buf, size);