mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 21:22:09 -04:00
Merge "net: qrtr: haven: Add bounds check on tx path"
This commit is contained in:
commit
aa89ee4a2c
1 changed files with 5 additions and 0 deletions
|
|
@ -188,6 +188,9 @@ static size_t haven_tx_avail(struct haven_pipe *pipe)
|
|||
else
|
||||
avail -= FIFO_FULL_RESERVE;
|
||||
|
||||
if (WARN_ON_ONCE(avail > pipe->length))
|
||||
avail = 0;
|
||||
|
||||
return avail;
|
||||
}
|
||||
|
||||
|
|
@ -198,6 +201,8 @@ static void haven_tx_write(struct haven_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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue