lkml.org 
[lkml]   [2012]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH -next] virtio: balloon: fix missing unlock on error in fill_balloon()
From
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);



\
 
 \ /
  Last update: 2012-11-12 15:21    [W:0.045 / U:0.828 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site