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:
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. */
|
/* Stop for now if there are not enough iovecs available. */
|
||||||
if (*num >= VIRTQUEUE_MAX_SIZE) {
|
if (*num >= VIRTQUEUE_MAX_SIZE) {
|
||||||
return -ENOBUFS;
|
error_report("Invalid SG num: %u", *num);
|
||||||
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO handle non-contiguous memory across region boundaries */
|
/* TODO handle non-contiguous memory across region boundaries */
|
||||||
|
Loading…
Reference in New Issue
Block a user