mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-15 01:01:56 -04:00
Merge "FROMGIT: media: venus: hfi: add check to handle incorrect queue size" into kernel.lnx.5.4.r9-rel
This commit is contained in:
commit
ee6d41445d
1 changed files with 6 additions and 0 deletions
|
|
@ -188,6 +188,9 @@ static int venus_write_queue(struct venus_hfi_device *hdev,
|
|||
/* ensure rd/wr indices's are read from memory */
|
||||
rmb();
|
||||
|
||||
if (qsize > IFACEQ_QUEUE_SIZE / 4)
|
||||
return -EINVAL;
|
||||
|
||||
if (wr_idx >= rd_idx)
|
||||
empty_space = qsize - (wr_idx - rd_idx);
|
||||
else
|
||||
|
|
@ -256,6 +259,9 @@ static int venus_read_queue(struct venus_hfi_device *hdev,
|
|||
wr_idx = qhdr->write_idx;
|
||||
qsize = qhdr->q_size;
|
||||
|
||||
if (qsize > IFACEQ_QUEUE_SIZE / 4)
|
||||
return -EINVAL;
|
||||
|
||||
/* make sure data is valid before using it */
|
||||
rmb();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue