From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adp2O-0007dv-N0 for qemu-devel@nongnu.org; Wed, 09 Mar 2016 20:05:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1adp2K-0006as-NJ for qemu-devel@nongnu.org; Wed, 09 Mar 2016 20:05:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46932) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adp2K-0006aQ-HV for qemu-devel@nongnu.org; Wed, 09 Mar 2016 20:05:08 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 11783C00B8F3 for ; Thu, 10 Mar 2016 01:05:08 +0000 (UTC) Date: Thu, 10 Mar 2016 09:05:03 +0800 From: Fam Zheng Message-ID: <20160310010503.GC23632@ad.usersys.redhat.com> References: <1457543818-16696-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1457543818-16696-1-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH] exec;fix early return from ram_block_add List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On Wed, 03/09 18:16, Paolo Bonzini wrote: In the subject: s/;/: / > After reporting an error, ram_block_add was going on with the registration > of the RAMBlock. The visible effect is that it unlocked the ramlist > mutex twice. > > Fixes: 528f46af6ecd1e300db18684969104d4067b867b Yes, this was my mistake in that patch. Thanks for the fix! Reviewed-by: Fam Zheng Fam > Cc: Fam Zheng > Signed-off-by: Paolo Bonzini > --- > exec.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/exec.c b/exec.c > index d972737..11a5fa1 100644 > --- a/exec.c > +++ b/exec.c > @@ -1588,6 +1588,7 @@ static void ram_block_add(RAMBlock *new_block, Error **errp) > if (err) { > error_propagate(errp, err); > qemu_mutex_unlock_ramlist(); > + return; > } > } else { > new_block->host = phys_mem_alloc(new_block->max_length, > @@ -1597,6 +1598,7 @@ static void ram_block_add(RAMBlock *new_block, Error **errp) > "cannot set up guest memory '%s'", > memory_region_name(new_block->mr)); > qemu_mutex_unlock_ramlist(); > + return; > } > memory_try_enable_merging(new_block->host, new_block->max_length); > } > -- > 2.5.0 >