mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
vring: Better error handling if num is too large
To be more consistent inside this function. Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1410329871-28885-3-git-send-email-famz@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
committed by
Stefan Hajnoczi
parent
d9612b43dd
commit
032f8b8158
@@ -181,7 +181,8 @@ static int get_desc(Vring *vring, VirtQueueElement *elem,
|
||||
|
||||
/* Stop for now if there are not enough iovecs available. */
|
||||
if (*num >= VIRTQUEUE_MAX_SIZE) {
|
||||
return -ENOBUFS;
|
||||
error_report("Invalid SG num: %u", *num);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
/* TODO handle non-contiguous memory across region boundaries */
|
||||
|
||||
Reference in New Issue
Block a user