From nobody Mon Apr 29 15:21:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563266582; cv=none; d=zoho.com; s=zohoarc; b=S+DT+yiPXq4FoB65cMiGFXtbQFaqMc46lSIgw2aR86UIA1i5wpnRetIxmkJs2k/4E7ZfhBSj9ODHCwMYgEvWAs7mqj/YL+/5MHtJoygb2ieNpVaSDrT9Pg9CUQRMb7S2f5aWjBl954SXomweeEb0nNqQpYFAOTuZUihxUl6ZPQc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563266582; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=tZNC+XxjyHCy723QmhoP/yNtMpfhUTS1BsgCg00/cJI=; b=dRGBd0u74B8KU8Xjv7tPaOUV/3xi4raJw4s/GIX4K75hSO0J0Vp//xwTFKLTkLeU8dx1/Y50wPNco26zOfsdZ6BUhTsbr2TcYvWDwNAmZ5kP37vTuZUAqF4dEu1Vvk8OaAZhlEvUrf+3E3Ddmd+e5p0k5pDo+Wv1CTxLpf9TlW0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 1563266582587374.6093934080095; Tue, 16 Jul 2019 01:43:02 -0700 (PDT) Received: from localhost ([::1]:46436 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnJ37-0002vz-Ch for importer@patchew.org; Tue, 16 Jul 2019 04:43:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41452) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnJ2x-0002WW-8B for qemu-devel@nongnu.org; Tue, 16 Jul 2019 04:42:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hnJ2w-0008Ql-6k for qemu-devel@nongnu.org; Tue, 16 Jul 2019 04:42:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38820) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hnJ2u-0008PV-2u; Tue, 16 Jul 2019 04:42:48 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5BC57309174E; Tue, 16 Jul 2019 08:42:47 +0000 (UTC) Received: from localhost (ovpn-112-54.ams2.redhat.com [10.36.112.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id D2C1660C05; Tue, 16 Jul 2019 08:42:43 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Tue, 16 Jul 2019 12:42:40 +0400 Message-Id: <20190716084240.17594-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 16 Jul 2019 08:42:47 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] nbd: fix uninitialized variable warning 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: Kevin Wolf , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "open list:Network Block Dev..." , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" ../block/nbd.c: In function 'nbd_co_request': ../block/nbd.c:745:8: error: 'local_reply.type' may be used uninitialized i= n this function [-Werror=3Dmaybe-uninitialized] if (chunk->type =3D=3D NBD_REPLY_TYPE_NONE) { ^ ../block/nbd.c:710:14: note: 'local_reply.type' was declared here NBDReply local_reply; ^~~~~~~~~~~ ../block/nbd.c:710:14: error: 'local_reply.flags' may be used uninitialized= in this function [-Werror=3Dmaybe-uninitialized] ../block/nbd.c:738:8: error: 'local_reply..magic' may be used uninit= ialized in this function [-Werror=3Dmaybe-uninitialized] if (nbd_reply_is_simple(reply) || s->quit) { ^ ../block/nbd.c:710:14: note: 'local_reply..magic' was declared here NBDReply local_reply; ^~~~~~~~~~~ cc1: all warnings being treated as errors Signed-off-by: Marc-Andr=C3=A9 Lureau Reported-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- block/nbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/nbd.c b/block/nbd.c index 81edabbf35..02eef09728 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -707,7 +707,7 @@ static bool nbd_reply_chunk_iter_receive(BDRVNBDState *= s, void **payload) { int ret, request_ret; - NBDReply local_reply; + NBDReply local_reply =3D { 0, }; NBDStructuredReplyChunk *chunk; Error *local_err =3D NULL; if (s->quit) { --=20 2.22.0.428.g6d5b264208