From patchwork Tue Jan 15 16:48:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 212244 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5E5F12C0097 for ; Wed, 16 Jan 2013 03:49:07 +1100 (EST) Received: from localhost ([::1]:48288 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv9hB-0001xW-1R for incoming@patchwork.ozlabs.org; Tue, 15 Jan 2013 11:49:05 -0500 Received: from eggs.gnu.org ([208.118.235.92]:32915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv9gr-0001jg-8d for qemu-devel@nongnu.org; Tue, 15 Jan 2013 11:48:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tv9gl-0005TO-Vu for qemu-devel@nongnu.org; Tue, 15 Jan 2013 11:48:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:13432) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv9gl-0005TI-Np for qemu-devel@nongnu.org; Tue, 15 Jan 2013 11:48:39 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0FGmdl4030268 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 15 Jan 2013 11:48:39 -0500 Received: from localhost (ovpn-112-16.ams2.redhat.com [10.36.112.16]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r0FGmboO027442; Tue, 15 Jan 2013 11:48:38 -0500 From: Stefan Hajnoczi To: Date: Tue, 15 Jan 2013 17:48:17 +0100 Message-Id: <1358268511-27061-2-git-send-email-stefanha@redhat.com> In-Reply-To: <1358268511-27061-1-git-send-email-stefanha@redhat.com> References: <1358268511-27061-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Kevin Wolf , Anthony Liguori , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 01/15] qcow2: Fix segfault on zero-length write X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Kevin Wolf One of the recent refactoring patches (commit f50f88b9) didn't take care to initialise l2meta properly, so with zero-length writes, which don't even enter the write loop, qemu just segfaulted. Signed-off-by: Kevin Wolf Signed-off-by: Stefan Hajnoczi --- block/qcow2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/qcow2.c b/block/qcow2.c index d603f98..f6abff6 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -759,7 +759,7 @@ static coroutine_fn int qcow2_co_writev(BlockDriverState *bs, QEMUIOVector hd_qiov; uint64_t bytes_done = 0; uint8_t *cluster_data = NULL; - QCowL2Meta *l2meta; + QCowL2Meta *l2meta = NULL; trace_qcow2_writev_start_req(qemu_coroutine_self(), sector_num, remaining_sectors);