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

Commit afda5df0 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "net: qrtr: fifo: Add bounds check on tx path" into kernel.lnx.4.19.r23-rel

parents 44e2ef8b be018d6f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -117,6 +117,9 @@ static size_t fifo_tx_avail(struct fifo_pipe *pipe)
	else
		avail = tail - head;

	if (WARN_ON_ONCE(avail > pipe->length))
		avail = 0;

	return avail;
}

@@ -127,6 +130,8 @@ static void fifo_tx_write(struct fifo_pipe *pipe,
	u32 head;

	head = le32_to_cpu(*pipe->head);
	if (WARN_ON_ONCE(head > pipe->length))
		return;

	len = min_t(size_t, count, pipe->length - head);
	if (len)