From 776ce1a5a1d60fbf61b7f9d1cb33e20488c10cba Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Thu, 29 Nov 2012 14:17:25 +1100 Subject: [PATCH] virtio_balloon-introduce-migration-primitives-to-balloon-pages-fix-fix avoid having multiple return points in fill_balloon() Cc: Wei Yongjun Cc: Rafael Aquini Signed-off-by: Andrew Morton --- drivers/virtio/virtio_balloon.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index eae1e03c30dd..99ba6c69139f 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -151,13 +151,9 @@ static void fill_balloon(struct virtio_balloon *vb, size_t num) totalram_pages--; } - /* Didn't get any? Oh well. */ - if (vb->num_pfns == 0) { - mutex_unlock(&vb->balloon_lock); - return; - } - - tell_host(vb, vb->inflate_vq); + /* Did we get any? */ + if (vb->num_pfns != 0) + tell_host(vb, vb->inflate_vq); mutex_unlock(&vb->balloon_lock); } -- 2.39.5