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

Commit a1531c64 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "net: qrtr: haven: Add bounds check in rx path"

parents aa89ee4a a97331a7
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -148,6 +148,9 @@ static void haven_rx_peak(struct haven_pipe *pipe, void *data,
	if (tail >= pipe->length)
		tail -= pipe->length;

	if (WARN_ON_ONCE(tail > pipe->length))
		return;

	len = min_t(size_t, count, pipe->length - tail);
	if (len)
		memcpy_fromio(data, pipe->fifo + tail, len);