mirror of
https://github.com/OpenAMP/open-amp.git
synced 2026-02-06 02:54:32 +08:00
virtqueue_add_consumed_buffer input parameter fix
head_idx must be restricted to 0 ... vq_nentries - 1 Signed-off-by: Tammy Leino <tammy_leino@mentor.com>
This commit is contained in:
committed by
Arnaud Pouliquen
parent
6d9df8fbac
commit
8590171dc1
@@ -302,7 +302,7 @@ int virtqueue_add_consumed_buffer(struct virtqueue *vq, uint16_t head_idx,
|
||||
struct vring_used_elem *used_desc = NULL;
|
||||
uint16_t used_idx;
|
||||
|
||||
if (head_idx > vq->vq_nentries) {
|
||||
if (head_idx >= vq->vq_nentries) {
|
||||
return ERROR_VRING_NO_BUFF;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user