From nobody Mon Feb 9 18:46:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=de.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1601481798; cv=none; d=zohomail.com; s=zohoarc; b=DtWE9aulTeY7EXqLDyV3fOEIhkpvzaAGpSckTt8MWdSZk0kms3o6pT/gZKg0f6WkjLNk74FK7Vnbw3CHiNegvFtiaIRPpMkF4K2vgAl/nM0iteiUNzKt8N37J+kDdRwRIM3kvztyosQYx7/XAFLGh1C8i7otYiDHvGQ4ga2P62o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601481798; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4jbzuzklvkZtovivYeLq/4Z+2yoD2zkSehVxqFzXxB0=; b=mGvr407rGJ4LHWI6wSmZktAEkfZVUdG2fJD9Sb90hh9GbAC6bNGEkcc92KePDJZak6VRM32BsaYfK9AlxW4R1WQ0/GRW+0n6S9Y1A94WDbPnYAG2jmhJ/oX+IYfw/YKrp3+pcVSgfuCvF+hN4HGJq0QskOCGvAnO1AGDTk5ETCo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1601481798350415.8916919813622; Wed, 30 Sep 2020 09:03:18 -0700 (PDT) Received: from localhost ([::1]:48324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kNeZZ-0001Rp-0W for importer@patchew.org; Wed, 30 Sep 2020 12:03:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kNeVy-0007PS-Bd; Wed, 30 Sep 2020 11:59:35 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:1186) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kNeVo-00021s-Ed; Wed, 30 Sep 2020 11:59:34 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08UFZ0Hp182393; Wed, 30 Sep 2020 11:59:06 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 33vv1qad0t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Sep 2020 11:59:06 -0400 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 08UFdPCO000999; Wed, 30 Sep 2020 11:59:06 -0400 Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 33vv1qacyd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Sep 2020 11:59:05 -0400 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 08UFw4kI025934; Wed, 30 Sep 2020 15:59:03 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma06ams.nl.ibm.com with ESMTP id 33v6mgs59b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Sep 2020 15:59:03 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 08UFx1nS23921086 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Sep 2020 15:59:01 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 00E144C044; Wed, 30 Sep 2020 15:59:01 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DE1C14C040; Wed, 30 Sep 2020 15:59:00 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Wed, 30 Sep 2020 15:59:00 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 25651) id 9B787E1FB0; Wed, 30 Sep 2020 17:59:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pp1; bh=4jbzuzklvkZtovivYeLq/4Z+2yoD2zkSehVxqFzXxB0=; b=Q/Puv350K3lj0bPyJSwcAq9xE8DjqU6eta9WkqouUgmocZOMCQRrK272yerSrWF7Nb1y BYN0xI3RfKCCtAlJpC0jMNAkSGuSKMqifdREIp6KDXgeaabWoCLZ9ApQsNBx7aUnT4Z5 hFyMezt1ejan6v8KhNUaYaGuXboI2h3+iNbvO/wonlmfAU5LmTHKCQ/L/8wmzsdUjNTl FFFwPn7bz068RHIElqp+rm+94X2Ss7gxu9uCAjAjBfAAYiepPKC/lik6B8l4RBLdm4lZ 6rL3X1O3fz/MLR1eSL7aTYlMS/yG58OHpOb41Y9GFyB/OYkjvIuhSDzX5p6KjYJ/skwl Sg== From: Christian Borntraeger To: qemu-devel@nongnu.org Subject: [PATCH 1/4] vmdk: fix maybe uninitialized warnings Date: Wed, 30 Sep 2020 17:58:56 +0200 Message-Id: <20200930155859.303148-2-borntraeger@de.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200930155859.303148-1-borntraeger@de.ibm.com> References: <20200930155859.303148-1-borntraeger@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-09-30_08:2020-09-30, 2020-09-30 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 spamscore=0 malwarescore=0 clxscore=1015 adultscore=0 phishscore=0 mlxscore=0 lowpriorityscore=0 bulkscore=0 mlxlogscore=999 suspectscore=4 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009300124 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.156.1; envelope-from=borntraeger@de.ibm.com; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/30 11:59:20 X-ACL-Warn: Detected OS = Linux 3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.373, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Kevin Wolf , qemu-block@nongnu.org, "Dr . David Alan Gilbert" , Max Reitz , Christian Borntraeger , Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Fedora 32 gcc 10 seems to give false positives: Compiling C object libblock.fa.p/block_vmdk.c.o ../block/vmdk.c: In function =E2=80=98vmdk_parse_extents=E2=80=99: ../block/vmdk.c:587:5: error: =E2=80=98extent=E2=80=99 may be used uninitia= lized in this function [-Werror=3Dmaybe-uninitialized] 587 | g_free(extent->l1_table); | ^~~~~~~~~~~~~~~~~~~~~~~~ ../block/vmdk.c:754:17: note: =E2=80=98extent=E2=80=99 was declared here 754 | VmdkExtent *extent; | ^~~~~~ ../block/vmdk.c:620:11: error: =E2=80=98extent=E2=80=99 may be used uniniti= alized in this function [-Werror=3Dmaybe-uninitialized] 620 | ret =3D vmdk_init_tables(bs, extent, errp); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../block/vmdk.c:598:17: note: =E2=80=98extent=E2=80=99 was declared here 598 | VmdkExtent *extent; | ^~~~~~ ../block/vmdk.c:1178:39: error: =E2=80=98extent=E2=80=99 may be used uninit= ialized in this function [-Werror=3Dmaybe-uninitialized] 1178 | extent->flat_start_offset =3D flat_offset << 9; | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ ../block/vmdk.c: In function =E2=80=98vmdk_open_vmdk4=E2=80=99: ../block/vmdk.c:581:22: error: =E2=80=98extent=E2=80=99 may be used uniniti= alized in this function [-Werror=3Dmaybe-uninitialized] 581 | extent->l2_cache =3D | ~~~~~~~~~~~~~~~~~^ 582 | g_malloc(extent->entry_size * extent->l2_size * L2_CACHE_SI= ZE); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~ ../block/vmdk.c:872:17: note: =E2=80=98extent=E2=80=99 was declared here 872 | VmdkExtent *extent; | ^~~~~~ ../block/vmdk.c: In function =E2=80=98vmdk_open=E2=80=99: ../block/vmdk.c:620:11: error: =E2=80=98extent=E2=80=99 may be used uniniti= alized in this function [-Werror=3Dmaybe-uninitialized] 620 | ret =3D vmdk_init_tables(bs, extent, errp); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../block/vmdk.c:598:17: note: =E2=80=98extent=E2=80=99 was declared here 598 | VmdkExtent *extent; | ^~~~~~ cc1: all warnings being treated as errors make: *** [Makefile.ninja:884: libblock.fa.p/block_vmdk.c.o] Error 1 fix them by assigning a default value. Signed-off-by: Christian Borntraeger Reviewed-by: Fam Zheng --- block/vmdk.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 8ec62c7ab798..a00dc00eb47a 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -595,7 +595,7 @@ static int vmdk_open_vmfs_sparse(BlockDriverState *bs, int ret; uint32_t magic; VMDK3Header header; - VmdkExtent *extent; + VmdkExtent *extent =3D NULL; =20 ret =3D bdrv_pread(file, sizeof(magic), &header, sizeof(header)); if (ret < 0) { @@ -751,7 +751,7 @@ static int vmdk_open_se_sparse(BlockDriverState *bs, int ret; VMDKSESparseConstHeader const_header; VMDKSESparseVolatileHeader volatile_header; - VmdkExtent *extent; + VmdkExtent *extent =3D NULL; =20 ret =3D bdrv_apply_auto_read_only(bs, "No write support for seSparse images available", errp); @@ -869,7 +869,7 @@ static int vmdk_open_vmdk4(BlockDriverState *bs, uint32_t magic; uint32_t l1_size, l1_entry_sectors; VMDK4Header header; - VmdkExtent *extent; + VmdkExtent *extent =3D NULL; BDRVVmdkState *s =3D bs->opaque; int64_t l1_backup_offset =3D 0; bool compressed; @@ -1088,7 +1088,7 @@ static int vmdk_parse_extents(const char *desc, Block= DriverState *bs, BdrvChild *extent_file; BdrvChildRole extent_role; BDRVVmdkState *s =3D bs->opaque; - VmdkExtent *extent; + VmdkExtent *extent =3D NULL; char extent_opt_prefix[32]; Error *local_err =3D NULL; =20 --=20 2.26.2