From 7c9b7ac66be7211df8decc956317a9a8d99eb942 Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Thu, 15 Nov 2012 13:37:53 +1100 Subject: [PATCH] virtio: balloon: fix missing unlock on error in fill_balloon() Add the missing unlock before return from function fill_balloon() in the error handling case. Introduced by 9864a8 ("virtio_balloon: introduce migration primitives to balloon pages"). dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun Signed-off-by: Andrew Morton --- drivers/virtio/virtio_balloon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index c298a9a09c0e..c2e4f18b5424 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -152,8 +152,10 @@ static void fill_balloon(struct virtio_balloon *vb, size_t num) } /* Didn't get any? Oh well. */ - if (vb->num_pfns == 0) + if (vb->num_pfns == 0) { + mutex_unlock(&vb->balloon_lock); return; + } tell_host(vb, vb->inflate_vq); mutex_unlock(&vb->balloon_lock); -- 2.39.5