From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rafael Aquini Subject: Re: [PATCH -next] virtio: balloon: fix missing unlock on error in fill_balloon() Date: Mon, 12 Nov 2012 12:16:54 -0200 Message-ID: <20121112141653.GA7228@optiplex.redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Wei Yongjun Cc: mst@redhat.com, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, yongjun_wei@trendmicro.com.cn, akpm@linux-foundation.org List-Id: virtualization@lists.linuxfoundation.org On Mon, Nov 12, 2012 at 09:50:40PM +0800, Wei Yongjun wrote: > 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); > I missed that one when rewriting v10 to v11. :( Good catch, Wei! thanks! Andrew, we need this pick for the virtio_balloon v12 patch, as well. -- Rafael