From patchwork Thu Sep 1 14:31:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 112917 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 78F6DB6F88 for ; Fri, 2 Sep 2011 00:28:37 +1000 (EST) Received: from localhost ([::1]:41447 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qz8Ft-0002Q5-Cd for incoming@patchwork.ozlabs.org; Thu, 01 Sep 2011 10:28:33 -0400 Received: from eggs.gnu.org ([140.186.70.92]:59878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qz8Fg-0002MX-TN for qemu-devel@nongnu.org; Thu, 01 Sep 2011 10:28:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qz8Ff-0008Gq-Oz for qemu-devel@nongnu.org; Thu, 01 Sep 2011 10:28:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12996) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qz8Ff-0008GM-E3 for qemu-devel@nongnu.org; Thu, 01 Sep 2011 10:28:19 -0400 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 (8.14.4/8.14.4) with ESMTP id p81ESIQl017523 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 1 Sep 2011 10:28:18 -0400 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p81ESFXC002440; Thu, 1 Sep 2011 10:28:17 -0400 From: Kevin Wolf To: qemu-devel@nongnu.org Date: Thu, 1 Sep 2011 16:31:09 +0200 Message-Id: <1314887471-18052-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1314887471-18052-1-git-send-email-kwolf@redhat.com> References: <1314887471-18052-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, lcapitulino@redhat.com Subject: [Qemu-devel] [PATCH 1/3] qcow2: Properly initialise QcowL2Meta 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 Dependency list pointers filled with random garbage from the stack aren't a good idea. Signed-off-by: Kevin Wolf --- block/qcow2.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index b725d68..f26f7b6 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -526,13 +526,14 @@ static int qcow2_co_writev(BlockDriverState *bs, int n_end; int ret; int cur_nr_sectors; /* number of sectors in current iteration */ - QCowL2Meta l2meta; uint64_t cluster_offset; QEMUIOVector hd_qiov; uint64_t bytes_done = 0; uint8_t *cluster_data = NULL; + QCowL2Meta l2meta = { + .nb_clusters = 0, + }; - l2meta.nb_clusters = 0; qemu_co_queue_init(&l2meta.dependent_requests); qemu_iovec_init(&hd_qiov, qiov->niov);