From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Molnar Subject: Re: [PATCH] x86: KVM, fix lock imbalance Date: Wed, 7 Jul 2010 16:10:08 +0200 Message-ID: <20100707141008.GA7419@elte.hu> References: <1278507745-32746-1-git-send-email-jirislaby@gmail.com> <20100707130545.GA14934@elte.hu> <4C347C0E.6020107@gmail.com> <4C347F3C.2010704@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jiri Slaby , linux-kernel@vger.kernel.org, Marcelo Tosatti , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Gleb Natapov , "Michael S. Tsirkin" , Gregory Haskins , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx3.mail.elte.hu ([157.181.1.138]:47243 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755207Ab0GGOKV (ORCPT ); Wed, 7 Jul 2010 10:10:21 -0400 Content-Disposition: inline In-Reply-To: <4C347F3C.2010704@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: * Avi Kivity wrote: > On 07/07/2010 04:07 PM, Jiri Slaby wrote: > > > >>A cleanliness comment: why is that tear-down/dealloc sequence open-coded? It > >>should be at the end of the function, with goto labels, like we do it in > >>similar cases. > >Because the lock is around a block only. I usually don't create a goto > >fail-paths in these cases. Do you want one? > > In any case, the patch is a minimal fix, so I'll apply it. Any clean ups > can go on top. The reason the pattern caught my attention is that it is one of the typical cases where goto labels help prevent similar bugs. I.e. had it been clean to begin with the bug might not have happened. Thanks, Ingo