add_buf returns ring size on out of memory,
this is not what devices expect.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: stable@kernel.org # .34.x
desc = kmalloc((out + in) * sizeof(struct vring_desc), gfp);
if (!desc)
desc = kmalloc((out + in) * sizeof(struct vring_desc), gfp);
if (!desc)
/* Transfer entries from the sg list into the indirect page */
for (i = 0; i < out; i++) {
/* Transfer entries from the sg list into the indirect page */
for (i = 0; i < out; i++) {