virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] virtio: balloon: fix missing unlock on error in fill_balloon()
@ 2012-11-12 13:50 Wei Yongjun
  2012-11-12 14:16 ` Rafael Aquini
  2012-11-12 23:34 ` Andrew Morton
  0 siblings, 2 replies; 4+ messages in thread
From: Wei Yongjun @ 2012-11-12 13:50 UTC (permalink / raw)
  To: rusty, mst, aquini; +Cc: yongjun_wei, linux-kernel, virtualization

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

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 <yongjun_wei@trendmicro.com.cn>
---
 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 f70151b..72e8dcb 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);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-11-13 12:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-12 13:50 [PATCH -next] virtio: balloon: fix missing unlock on error in fill_balloon() Wei Yongjun
2012-11-12 14:16 ` Rafael Aquini
2012-11-12 23:34 ` Andrew Morton
2012-11-13 12:47   ` Rafael Aquini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).