summaryrefslogtreecommitdiffstats
path: root/hw/virtio
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2014-09-10 14:17:50 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2014-09-22 11:39:49 +0100
commit032f8b8158eaab94573340c883cb6cd03cea1117 (patch)
tree571dcc081a72b935a8c7d7dbdd76d99b2f59cb80 /hw/virtio
parentd9612b43dd062309a6a4ad4e5cef2badc94f5385 (diff)
downloadhqemu-032f8b8158eaab94573340c883cb6cd03cea1117.zip
hqemu-032f8b8158eaab94573340c883cb6cd03cea1117.tar.gz
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>
Diffstat (limited to 'hw/virtio')
-rw-r--r--hw/virtio/dataplane/vring.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/virtio/dataplane/vring.c b/hw/virtio/dataplane/vring.c
index 67cb2b8..372706a 100644
--- a/hw/virtio/dataplane/vring.c
+++ b/hw/virtio/dataplane/vring.c
@@ -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 */
OpenPOWER on IntegriCloud