Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753043Ab2KLNum (ORCPT ); Mon, 12 Nov 2012 08:50:42 -0500 Received: from mail-qc0-f174.google.com ([209.85.216.174]:56949 "EHLO mail-qc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752982Ab2KLNul (ORCPT ); Mon, 12 Nov 2012 08:50:41 -0500 MIME-Version: 1.0 Date: Mon, 12 Nov 2012 21:50:40 +0800 Message-ID: Subject: [PATCH -next] virtio: balloon: fix missing unlock on error in fill_balloon() From: Wei Yongjun To: rusty@rustcorp.com.au, mst@redhat.com, aquini@redhat.com Cc: yongjun_wei@trendmicro.com.cn, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1203 Lines: 39 From: Wei Yongjun 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 --- 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); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/