From nobody Sun Nov 24 21:37:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1720097434; cv=none; d=zohomail.com; s=zohoarc; b=d6dw8AgC2aZ6uyhsGL/+Nay6CHzITEGlQm6lek3PJ6ttFOigqnGhMlVy1YNI28cKMdlrvYtNaCscIn9mefV2tDoQ5PzUr+vQwG762ThmLkjftxDLbQmcaExhZfxM4VN+knw8+Jt/hzJw9qy3PxstkVE6bXUuWu2PnD/JsUAQufk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720097434; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=mE9NVMNgeMpdIBYLHPdIh0Aogurvyr2VaxgmAxGfLmI=; b=hihaPH8B5eQJxyCzs6Vq3IuuByE5gryjtK4h7H613/tpM/F1bQQChjJeKzm+MSh9K7ZkRIPDlLC+Lf4TLP+8ilil0iX02rdomaETrk1LkkED+xG0K0REeuAECCR/HL0owO2zKF+GLW6Gej2GFzmeY0qyHMd90pe5JPbCklO5sI8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1720097434492116.58079193754202; Thu, 4 Jul 2024 05:50:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPLuJ-0005i1-53; Thu, 04 Jul 2024 08:49:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPLtm-0004gc-Tw for qemu-devel@nongnu.org; Thu, 04 Jul 2024 08:49:19 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sPLti-0006WE-HQ for qemu-devel@nongnu.org; Thu, 04 Jul 2024 08:49:18 -0400 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-58c2e5e8649so2633125a12.1 for ; Thu, 04 Jul 2024 05:49:14 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5861381868csm8327192a12.55.2024.07.04.05.49.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 05:49:11 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id A9FE05F839; Thu, 4 Jul 2024 13:49:10 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720097353; x=1720702153; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=mE9NVMNgeMpdIBYLHPdIh0Aogurvyr2VaxgmAxGfLmI=; b=TyHQbsYxd92JNCOdwESYkzhxd2wtqp/CXZ83CFRvupRMewwwvXhVEy8fvJcykuy50n 7wHJo5qGX23Ywc35weHJvVDFZKH6SV0R86DcsV1y+6m+/Ey6mcqBIAkTPxRFMhigmAOa tuHVKbbfzcE2yRpo9GDtuKz1eLAUAgb03QgWbk/Yvt3bbXMoz3K/zxfU5B1GBp28DSdM 4Y0/srIS0xYQ4xqdFvzSU1rcan8NJzeKfFydupdJ/4Ql+zqBOkAtf4xbFd+CyzW1GLvp BkiYrRXqNR+UbqM93oy2F2qvpcPb+aNhXRPqavOCjzQ05QMNIVJJEReLkqEvpMeVxJfh bm8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720097353; x=1720702153; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mE9NVMNgeMpdIBYLHPdIh0Aogurvyr2VaxgmAxGfLmI=; b=oLSAsL43Zri3HzIrebMkygH1DkcByaQ36xI638nidoxICfzNZq0kcqIUnBavJHpHyP JPk48SIStZZU6C+9cB1uOnOM2xD1/Yj2ybbCuzvPX7WH0AJ2E2Rf3+VGo9Yzjaqkl5VJ XcSj4Gx+JEGki3D+m8gAvCcNWf7C2vRSCCcJPLLgs+VkR5AOLmcdzbl4GMDGethmCATo NxATSlW6c9tG3DnXVI6ih+IV3F52TzqyQkJdCshpG6g0ilX4cf1yOTbLsEA7zonLZGez zInwP/lh+veoqnuRVHuI9t4422Sso2lYzolmVXxIOYkAS2N6bLJ1Pv0SO3Dk7JPakVix xLbg== X-Gm-Message-State: AOJu0YzDfhMvC9JuYKTldHjK/TKOqwtmVR/8ajMfNIYLHW2NqBREWydD PnUJYBnVReuPPWVuy+3ew5eCdk7VwlmRhzzlbmbIq2JeN6X3o3Sm6qOz7v0MBZQ= X-Google-Smtp-Source: AGHT+IFzjusZs1x4NIxFmn6I6SEK1JhfdfIwTfj27mVmL9vmASC1hLcself7wYYASaUyxhsZXjbluA== X-Received: by 2002:a05:6402:5110:b0:57c:c171:2fb6 with SMTP id 4fb4d7f45d1cf-58e7a74d33dmr1041672a12.1.1720097352521; Thu, 04 Jul 2024 05:49:12 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paul Burton , Aleksandar Rikalo Subject: [RFC PATCH] hw/core: ensure kernel_end never gets used undefined Date: Thu, 4 Jul 2024 13:49:04 +0100 Message-Id: <20240704124904.276603-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::529; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x529.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1720097435281100001 Really the problem here is the return values of fit_load_[kernel|fdt]() are= a little all over the place. However we don't want to somehow get through not having set kernel_end and having it just be random unused data. The compiler complained on an --enable-gcov build: In file included from ../../hw/core/loader-fit.c:20: /home/alex/lsrc/qemu.git/include/qemu/osdep.h: In function =E2=80=98load_= fit=E2=80=99: /home/alex/lsrc/qemu.git/include/qemu/osdep.h:486:45: error: =E2=80=98ker= nel_end=E2=80=99 may be used uninitialized [-Werror=3Dmaybe-uninitialized] 486 | #define ROUND_UP(n, d) ROUND_DOWN((n) + (d) - 1, (d)) | ^ ../../hw/core/loader-fit.c:270:12: note: =E2=80=98kernel_end=E2=80=99 was= declared here 270 | hwaddr kernel_end; | ^~~~~~~~~~ Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Aleksandar Rikalo --- hw/core/loader-fit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/loader-fit.c b/hw/core/loader-fit.c index 9f20007dbb..7ccc9d5fbc 100644 --- a/hw/core/loader-fit.c +++ b/hw/core/loader-fit.c @@ -267,7 +267,7 @@ int load_fit(const struct fit_loader *ldr, const char *= filename, void *opaque) const char *def_cfg_name; char path[FIT_LOADER_MAX_PATH]; int itb_size, configs, cfg_off, off; - hwaddr kernel_end; + hwaddr kernel_end =3D 0; int ret; =20 itb =3D load_device_tree(filename, &itb_size); --=20 2.39.2