Home Home > GIT Browse > SLE12-SP4-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-05-13 15:57:09 +0200
committerTakashi Iwai <tiwai@suse.de>2019-05-13 15:57:14 +0200
commit87588e291e05e828085a53c1d33ac1c1ec9da5af (patch)
tree45a74ba42a9a3a073ca0e4d1f2210595a97a5513
parent207ed74c717a8d4066c3265be50a68469d11dceb (diff)
virtio: Honour 'may_reduce_num' in vring_create_virtqueue
(bsc#1051510). suse-commit: 6a41b174696a549e8975904cace827c8704b02a1
-rw-r--r--drivers/virtio/virtio_ring.c2
-rw-r--r--include/linux/virtio_ring.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 30bc03f2bf12..151dee26eaf4 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -1097,6 +1097,8 @@ struct virtqueue *vring_create_virtqueue(
GFP_KERNEL|__GFP_NOWARN|__GFP_ZERO);
if (queue)
break;
+ if (!may_reduce_num)
+ return NULL;
}
if (!num)
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
index 270cfa81830e..d502e15e4e8e 100644
--- a/include/linux/virtio_ring.h
+++ b/include/linux/virtio_ring.h
@@ -62,7 +62,7 @@ struct virtqueue;
/*
* Creates a virtqueue and allocates the descriptor ring. If
* may_reduce_num is set, then this may allocate a smaller ring than
- * expected. The caller should query virtqueue_get_ring_size to learn
+ * expected. The caller should query virtqueue_get_vring_size to learn
* the actual size of the ring.
*/
struct virtqueue *vring_create_virtqueue(unsigned int index,