From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvSls-0004pU-Rt for qemu-devel@nongnu.org; Wed, 16 Jan 2013 08:11:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvSlq-0005BJ-2B for qemu-devel@nongnu.org; Wed, 16 Jan 2013 08:11:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58942) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvSUr-0000Fe-Nf for qemu-devel@nongnu.org; Wed, 16 Jan 2013 07:53:37 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0GCraYv027491 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 16 Jan 2013 07:53:36 -0500 Date: Wed, 16 Jan 2013 13:53:34 +0100 From: Stefan Hajnoczi Message-ID: <20130116125334.GB8511@stefanha-thinkpad.redhat.com> References: <82f8ffaa908befab90470a79e0feb105af9aad84.1358264426.git.jcody@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <82f8ffaa908befab90470a79e0feb105af9aad84.1358264426.git.jcody@redhat.com> Subject: Re: [Qemu-devel] [PATCH] block: fix null-pointer bug on error case in block commit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jeff Cody Cc: kwolf@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com On Tue, Jan 15, 2013 at 10:47:24AM -0500, Jeff Cody wrote: > This is a bug that was caught by a coverity run by Markus. In > the error case when we errored out to exit_restore_open early in the > function, 'overlay_bs' was still NULL at that point, although it is > used to look up flags and perform a bdrv_reopen(). > > Move the overlay_bs lookup to where it is needed, and check for NULL > before restoring the flags. Also get rid of the unneeded parameter > initialization. > > Reported-By: Markus Armbruster > Signed-off-by: Jeff Cody > --- > block/commit.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) Thanks, applied to my block tree: https://github.com/stefanha/qemu/commits/block Stefan