From: Wei Yongjun Date: Thu, 29 Nov 2012 03:17:25 +0000 (+1100) Subject: virtio: balloon: fix missing unlock on error in fill_balloon() X-Git-Tag: next-20121205~1^2~302 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=438e825cef3ae3bcca7a2eaa66491cd6f1829851;p=karo-tx-linux.git 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 --- diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 8f92ab788b0e..eae1e03c30dd 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);