From nobody Mon Sep 29 22:23:04 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22E49C19F2C for ; Tue, 16 Aug 2022 04:58:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234051AbiHPE63 (ORCPT ); Tue, 16 Aug 2022 00:58:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234029AbiHPE52 (ORCPT ); Tue, 16 Aug 2022 00:57:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2DE4BC826; Mon, 15 Aug 2022 13:51:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B186260FC4; Mon, 15 Aug 2022 20:51:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9DD9DC433C1; Mon, 15 Aug 2022 20:51:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596698; bh=nOfKq7c1vjoucNhMxCONBAKa9x7dzyly5obHXmxWhyY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MppmfOHLr0vuZTa/kco1xPvcGYdmx/xJPiziLjv9xsbzPIdhVroANVpoZ2FHX7TuM Y6TQu+5FY9OyunOjVVVkpvORJtTPuUa+FhzmFaa1GUiOYiprTyQFDC28Q48CkQVe8u bGzg85yafDrFnCxu3S3JiVp29vdSW+WvlXpRIDOU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe Leroy , Russell Currey , Michael Ellerman Subject: [PATCH 5.19 1155/1157] powerpc/kexec: Fix build failure from uninitialised variable Date: Mon, 15 Aug 2022 20:08:31 +0200 Message-Id: <20220815180526.750054495@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Russell Currey commit 83ee9f23763a432a4077bf20624ee35de87bce99 upstream. clang 14 won't build because ret is uninitialised and can be returned if both prop and fdtprop are NULL. Drop the ret variable and return an error in that failure case. Fixes: b1fc44eaa9ba ("pseries/iommu/ddw: Fix kdump to work in absence of ib= m,dma-window") Suggested-by: Christophe Leroy Signed-off-by: Russell Currey Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220810054331.373761-1-ruscur@russell.cc Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kexec/file_load_64.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/arch/powerpc/kexec/file_load_64.c +++ b/arch/powerpc/kexec/file_load_64.c @@ -1043,17 +1043,17 @@ static int copy_property(void *fdt, int const char *propname) { const void *prop, *fdtprop; - int len =3D 0, fdtlen =3D 0, ret; + int len =3D 0, fdtlen =3D 0; =20 prop =3D of_get_property(dn, propname, &len); fdtprop =3D fdt_getprop(fdt, node_offset, propname, &fdtlen); =20 if (fdtprop && !prop) - ret =3D fdt_delprop(fdt, node_offset, propname); + return fdt_delprop(fdt, node_offset, propname); else if (prop) - ret =3D fdt_setprop(fdt, node_offset, propname, prop, len); - - return ret; + return fdt_setprop(fdt, node_offset, propname, prop, len); + else + return -FDT_ERR_NOTFOUND; } =20 static int update_pci_dma_nodes(void *fdt, const char *dmapropname)