virtio: return ENOMEM on out of memory
Michael S. Tsirkin
maintainerPATCH 1/1 virtio: return ENOMEM on out of memory
add_buf returns ring size on out of memory,
this is not what devices expect.
Signed-off-by Michael S. Tsirkin <[email protected]>
---
Please consider this patch for 2.6.35.
drivers/virtio/virtio_ring.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/virtio/virtio_ring.c +1 -1
@@ -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++) {
Signature · 1 line
1.7.1.12.g42b7f
Quoted 4 lines · Michael S. Tsirkin
add_bufreturns 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]>
Amit
Quoted 4 lines · Michael S. Tsirkin
add_bufreturns ring size on out of memory,
this is not what devices expect.Signed-off-by Michael S. Tsirkin <[email protected]>
Yep. These should all be cc'd to -stable as well?
Thanks,
Rusty.