diff options
author | JohnnLee <johnnlee@google.com> | 2023-05-03 14:26:50 +0800 |
---|---|---|
committer | JohnnLee <johnnlee@google.com> | 2023-05-03 14:27:21 +0800 |
commit | 1a6434ad9cc059b499e85546ce15c670f07dca69 (patch) | |
tree | 0c12deef53fe26c9d0a16704f1d1e7cc9b60e87c | |
parent | ad29e12f916ee98aa4233ec8429041170db19bab (diff) | |
parent | b72f86df43c04c69294b7d8eddfbb4e1bcc3123c (diff) | |
download | msm-1a6434ad9cc059b499e85546ce15c670f07dca69.tar.gz |
Merge branch 'android-msm-pixel-4.19-tm-security' into android-msm-pixel-4.19-tm-qpr3
Bug: 276750306
Change-Id: Iaacf4707a8669228a124e30517c04c9336ac44c2
Signed-off-by: JohnnLee <johnnlee@google.com>
-rw-r--r-- | net/qrtr/fifo.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/qrtr/fifo.c b/net/qrtr/fifo.c index 4a1dd07e2de1..b3e80b315c44 100644 --- a/net/qrtr/fifo.c +++ b/net/qrtr/fifo.c @@ -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) |