From nobody Sun May 5 07:16:07 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=1563271676; cv=none; d=zoho.com; s=zohoarc; b=PxutE0kEPrYI2iSgCnI49bY14bxuovALrIvUuMDdfz2aiRFS8adi5oOFpxBdhSEl6zT4Xbj+R294Ou+jK7XXw1v2/lpNs3GoCaPn/yFuyCJwZatjjGmE27Ltg8tpwpim4CwyW9cp/SRH/5/XNJv2eCf8uZnRQ++WcvwgtOSIjrQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563271676; 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=vZKD0mMPLwInrKYB4BgZ8tY9/KPjyz/jR5Q9qtcBHNI=; b=M/TLT9lMv46Kvw+Y0OEaZ4Uz1yvI7Rk0TseWi/yrhovlVlegaAQfR/+XR2FBbPoBbf++lv/K3RvZxpFMRGBlJxxAWg7sR/jiBRXj2cuM88gJfIz16/pOTr37UUG9JNITHGt1nOQLPQXfZa9i74gTi8/dUMemI+bTgocGKfklVCk= 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 1563271676473572.8884890547673; Tue, 16 Jul 2019 03:07:56 -0700 (PDT) Received: from localhost ([::1]:46894 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnKNG-0007tL-UV for importer@patchew.org; Tue, 16 Jul 2019 06:07:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41110) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnKN6-0007SM-T4 for qemu-devel@nongnu.org; Tue, 16 Jul 2019 06:07:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hnKN4-0002Gs-W8 for qemu-devel@nongnu.org; Tue, 16 Jul 2019 06:07:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50480) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hnKN1-0002Dx-QH; Tue, 16 Jul 2019 06:07:40 -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 9542B8667E; Tue, 16 Jul 2019 10:07:37 +0000 (UTC) Received: from localhost (ovpn-112-54.ams2.redhat.com [10.36.112.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id 46B2F60C44; Tue, 16 Jul 2019 10:07:33 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Tue, 16 Jul 2019 14:07:31 +0400 Message-Id: <20190716100731.29843-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.26]); Tue, 16 Jul 2019 10:07:37 +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 v2] 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 Reported-by: Thomas Huth Signed-off-by: Marc-Andr=C3=A9 Lureau 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..0f74c1e455 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 {}; NBDStructuredReplyChunk *chunk; Error *local_err =3D NULL; if (s->quit) { --=20 2.22.0.428.g6d5b264208