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

This commit is contained in:
qctecmdr 2023-01-03 18:21:31 -08:00 committed by Gerrit - the friendly Code Review server
commit 7247a2a87f

View File

@ -149,6 +149,9 @@ static void gunyah_rx_peak(struct gunyah_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);