提交 032f8b81 编写于 作者: F Fam Zheng 提交者: Stefan Hajnoczi

vring: Better error handling if num is too large

To be more consistent inside this function.
Signed-off-by: NFam Zheng <famz@redhat.com>
Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
Message-id: 1410329871-28885-3-git-send-email-famz@redhat.com
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
上级 d9612b43
......@@ -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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册