Skip to content
Commit 1fe9b6fe authored by Michael S. Tsirkin's avatar Michael S. Tsirkin Committed by Linus Torvalds
Browse files

virtio: fix oops on OOM



virtio ring was changed to return an error code on OOM,
but one caller was missed and still checks for vq->vring.num.
The fix is just to check for <0 error code.

Long term it might make sense to change goto add_head to
just return an error on oom instead, but let's apply
a minimal fix for 2.6.35.

Reported-by: default avatarChris Mason <chris.mason@oracle.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Tested-by: default avatarChris Mason <chris.mason@oracle.com>
Cc: stable@kernel.org # .34.x
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2e65a207
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment