From nobody Thu Dec 18 08:09:16 2025 Delivered-To: importer@patchew.org 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; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576672270; cv=none; d=zohomail.com; s=zohoarc; b=ZY/1LaFTPLyZOc+U+aNeXmaG1xzFrsFSO4s+2qj1DV2NWvYzIlbgDz3HTUemvlZAhW8PN3ltEcFJ4ywpoOtKYBouMuTgcRmhYIfrtpysK2px4RgxtKgQ9S7GFbIkbqpIRTkpZe+bM9Jd/3sYjkR68bfhcAikpaqEU45r4PctkFQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576672270; 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=M7st8zYRftA//6nYaWbb7lkO5v3FUGpG+F+usf39Ve4=; b=K8fRWIALL218JLaHUb6GeWDJhlK7Y2sFg1lEa9DBW4cy/Gj8mPuE1PH0cXHNqBOtZQvW5xIbdYJAFRvgYiTwlila1zjnEWFB/vkDNGTkWGH39VHYxMdckx2GsQuPzxT3N3/tpIE3UZse5Cer0bB4VVXy1NJicmWrWyzMrH+czDQ= 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 1576672270785436.0527061672318; Wed, 18 Dec 2019 04:31:10 -0800 (PST) Received: from localhost ([::1]:53492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihYTt-0001lx-K8 for importer@patchew.org; Wed, 18 Dec 2019 07:31:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48267) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihY3A-0006MZ-Q8 for qemu-devel@nongnu.org; Wed, 18 Dec 2019 07:03:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihY39-0000hv-Ju for qemu-devel@nongnu.org; Wed, 18 Dec 2019 07:03:32 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:37766) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihY39-0000eD-9l for qemu-devel@nongnu.org; Wed, 18 Dec 2019 07:03:31 -0500 Received: by mail-wm1-x332.google.com with SMTP id f129so1611039wmf.2 for ; Wed, 18 Dec 2019 04:03:31 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id n67sm2236838wmf.46.2019.12.18.04.03.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Dec 2019 04:03:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=M7st8zYRftA//6nYaWbb7lkO5v3FUGpG+F+usf39Ve4=; b=YfRJFl5VtYNlKCyjkld3TPF8k1UR3owE4ZgFqyH+mbdGd2b1eRM0XOaJQtgvyMH/lH mxPTB+J9CQ2c/4RORI8w3+TdZ6TgF8t9nV6PwCgyK59J0HljDMoC3umWYNbJqtlxCOcm /mLJxqy/WgWA1+6PU+L91+8G+rSqEThDJ/ybVXVU2K/CBuVDYpdvV/YRd5s8x4CmsN9s 78hGFpfqklfWyYQJweSn291wubwrsuKFNRRTg21BfcxoBmIfciCwabnwKwRX8OAWZrdw DRZKQgOi/4JuwuHRQvjFjlF16TRj1WE9ZYyZ3706KoW4q1bOaNufB13p/9goNHip1YBx 4/lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=M7st8zYRftA//6nYaWbb7lkO5v3FUGpG+F+usf39Ve4=; b=lBONz5Bf/8rbUHKVIkBa15uaSFSMDitEOuFHdvtkSrX385yTL19BMnzp3vY+vsdBMB 4Pm+lIKOvD1BPD8ERlAJYqr4iHtuC0ygd7KnmHCJewvOX3CWnEn2xG5psCL7TyUqyV0u Dmhp+MOBiUCZsIGmhagpuDbDp3sjaRo0UNV6Z/UUdVo9AL0iEdMNDNl2HPwzh5sggzNY zmcNO0MavOS9bogZ5zSRV5EA2qbppoykGC22tpBedHvWfIEkf8MsKI6AP+QoKUB3kvxl +T7PtlBwJqWlb2p9Od0fw3xcOqUXGNIJfI/fRY+rGfDdjqXhRFBbEq936O0FdSQ753e4 fPTA== X-Gm-Message-State: APjAAAVGLp7zXSEckiD443rMp96hD73ZbVVoMJB/zgs0+4Y0xk4elN0d 6VYpMomwJM9Igk87q7nLrzMc1jVY X-Google-Smtp-Source: APXvYqxC01kCDU71i1V4ZVX8np9KmBC21m9bVHDEXAardiJnHHkPeLxsj9uRKiVYKV+mVkZq0zIhow== X-Received: by 2002:a7b:c317:: with SMTP id k23mr2887169wmj.75.1576670609806; Wed, 18 Dec 2019 04:03:29 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 34/87] migration: fix maybe-uninitialized warning Date: Wed, 18 Dec 2019 13:02:00 +0100 Message-Id: <1576670573-48048-35-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1576670573-48048-1-git-send-email-pbonzini@redhat.com> References: <1576670573-48048-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::332 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: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Marc-Andr=C3=A9 Lureau ../migration/ram.c: In function =E2=80=98multifd_recv_thread=E2=80=99: /home/elmarco/src/qq/include/qapi/error.h:165:5: error: =E2=80=98block=E2= =80=99 may be used uninitialized in this function [-Werror=3Dmaybe-uninitia= lized] 165 | error_setg_internal((errp), __FILE__, __LINE__, __func__, \ | ^~~~~~~~~~~~~~~~~~~ ../migration/ram.c:818:15: note: =E2=80=98block=E2=80=99 was declared here 818 | RAMBlock *block; | ^~~~~ Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Paolo Bonzini --- migration/ram.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 38070f1..219e3ca 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -863,15 +863,17 @@ static int multifd_recv_unfill_packet(MultiFDRecvPara= ms *p, Error **errp) p->next_packet_size =3D be32_to_cpu(packet->next_packet_size); p->packet_num =3D be64_to_cpu(packet->packet_num); =20 - if (p->pages->used) { - /* make sure that ramblock is 0 terminated */ - packet->ramblock[255] =3D 0; - block =3D qemu_ram_block_by_name(packet->ramblock); - if (!block) { - error_setg(errp, "multifd: unknown ram block %s", - packet->ramblock); - return -1; - } + if (p->pages->used =3D=3D 0) { + return 0; + } + + /* make sure that ramblock is 0 terminated */ + packet->ramblock[255] =3D 0; + block =3D qemu_ram_block_by_name(packet->ramblock); + if (!block) { + error_setg(errp, "multifd: unknown ram block %s", + packet->ramblock); + return -1; } =20 for (i =3D 0; i < p->pages->used; i++) { --=20 1.8.3.1