From: Greg KH on
2.6.34-stable review patch. If anyone has any objections, please let us know.

------------------

From: Michael S. Tsirkin <mst(a)redhat.com>

commit 686d363786a53ed28ee875b84ef24e6d5126ef6f upstream.

add_buf returns ring size on out of memory,
this is not what devices expect.

Signed-off-by: Michael S. Tsirkin <mst(a)redhat.com>
Acked-by: Amit Shah <amit.shah(a)redhat.com>
Signed-off-by: Rusty Russell <rusty(a)rustcorp.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)suse.de>

---
drivers/virtio/virtio_ring.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -118,7 +118,7 @@ static int vring_add_indirect(struct vri

desc = kmalloc((out + in) * sizeof(struct vring_desc), GFP_ATOMIC);
if (!desc)
- return vq->vring.num;
+ return -ENOMEM;

/* Transfer entries from the sg list into the indirect page */
for (i = 0; i < out; i++) {


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/