]> Git Repo - linux.git/commitdiff
virtio: return ENOMEM on out of memory
authorMichael S. Tsirkin <[email protected]>
Thu, 10 Jun 2010 15:16:11 +0000 (18:16 +0300)
committerRusty Russell <[email protected]>
Wed, 23 Jun 2010 13:19:06 +0000 (22:49 +0930)
add_buf returns ring size on out of memory,
this is not what devices expect.

Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Amit Shah <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
Cc: [email protected] # .34.x
drivers/virtio/virtio_ring.c

index 1ca88908723badfcb3aa9d07463b8f2988c28981..afe7e21dd0ae8a7dce4db7ee1a480ce931c42247 100644 (file)
@@ -119,7 +119,7 @@ static int vring_add_indirect(struct vring_virtqueue *vq,
 
        desc = kmalloc((out + in) * sizeof(struct vring_desc), gfp);
        if (!desc)
-               return vq->vring.num;
+               return -ENOMEM;
 
        /* Transfer entries from the sg list into the indirect page */
        for (i = 0; i < out; i++) {
This page took 0.059212 seconds and 4 git commands to generate.