]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
virtio: balloon: fix missing unlock on error in fill_balloon()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Thu, 29 Nov 2012 03:17:25 +0000 (14:17 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 5 Dec 2012 05:23:10 +0000 (16:23 +1100)
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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/virtio/virtio_balloon.c

index 8f92ab788b0e2d929aa1ba2a2c1e0c50024e14c6..eae1e03c30ddb4f970e585dd6247332c40de7413 100644 (file)
@@ -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);