aboutsummaryrefslogtreecommitdiff
path: root/drivers/virtio/virtio_mmio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/virtio/virtio_mmio.c')
-rw-r--r--drivers/virtio/virtio_mmio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
index 5d7fee385b70..09edeecd42a5 100644
--- a/drivers/virtio/virtio_mmio.c
+++ b/drivers/virtio/virtio_mmio.c
@@ -334,8 +334,8 @@ static struct virtqueue *vm_setup_vq(struct virtio_device *vdev, unsigned index,
while (1) {
size = PAGE_ALIGN(vring_size(info->num,
VIRTIO_MMIO_VRING_ALIGN));
- /* Already smallest possible allocation? */
- if (size <= VIRTIO_MMIO_VRING_ALIGN * 2) {
+ /* Did the last iter shrink the queue below minimum size? */
+ if (size < VIRTIO_MMIO_VRING_ALIGN * 2) {
err = -ENOMEM;
goto error_alloc_pages;
}