mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 08:07:32 -04:00
Merge "FROMLIST: media: venus: Add a check for packet size"
This commit is contained in:
commit
e9e4ee369b
1 changed files with 4 additions and 0 deletions
|
|
@ -240,6 +240,7 @@ static int venus_write_queue(struct venus_hfi_device *hdev,
|
|||
static int venus_read_queue(struct venus_hfi_device *hdev,
|
||||
struct iface_queue *queue, void *pkt, u32 *tx_req)
|
||||
{
|
||||
struct hfi_pkt_hdr *pkt_hdr = NULL;
|
||||
struct hfi_queue_header *qhdr;
|
||||
u32 dwords, new_rd_idx;
|
||||
u32 rd_idx, wr_idx, type, qsize;
|
||||
|
|
@ -305,6 +306,9 @@ static int venus_read_queue(struct venus_hfi_device *hdev,
|
|||
memcpy(pkt, rd_ptr, len);
|
||||
memcpy(pkt + len, queue->qmem.kva, new_rd_idx << 2);
|
||||
}
|
||||
pkt_hdr = (struct hfi_pkt_hdr *)(pkt);
|
||||
if ((pkt_hdr->size >> 2) != dwords)
|
||||
return -EINVAL;
|
||||
} else {
|
||||
/* bad packet received, dropping */
|
||||
new_rd_idx = qhdr->write_idx;
|
||||
|
|
|
|||
Loading…
Reference in a new issue