Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3262077rwb; Mon, 15 Aug 2022 22:37:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR5FUB9wQ+0RFGY7XusPrUOYidwYmyLpqaPPVPv93+3ft+YFCypqWTz1+GUFJOooFeDm3FxD X-Received: by 2002:a17:907:3d90:b0:730:a7d2:23f0 with SMTP id he16-20020a1709073d9000b00730a7d223f0mr12296625ejc.358.1660628257069; Mon, 15 Aug 2022 22:37:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660628257; cv=none; d=google.com; s=arc-20160816; b=clsW+NGD972sYeixnKk+3gmbKAb/IrzPfpscfeQxW8upuZoheoaP0y2PVcZ6TT0qPb 3BpXuf89hUGGrPsFvF8jq6Tj25zfZeS51XLnokupbB1+dv0ATkeufpqaW8TGjic/T5O7 5zMmhCSlm9INgT0NfkW862WsE+otIh6r6xy/FhsjZS6RXFo/ysaZKNM4gQsBF05Uwqet X6Ur1Rqo7wfix75UDBRDtKoKScai5F92vZEmrJJQtX6E2YqmlGAwiA1Bgt6yHaPrPL3x Aegkpcd6dqBfnkW+kkMafEIumfMrZsSPn5tBXZZResEk/o01n45jHHhRKMpHgrn29MmQ 0+Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5npFV1dgrdzWijctcv08nBtsPrKKmRehnRU+3xOnuTk=; b=UaOtVJ2zHZ1qL5TDlAyfkw5szSqymHmlfNIId9rZy+PIbjjDMbFw1fFJ1y/QMfm5oj DsFryIU89YA/YKW6Nm9OHM72S4dAEiyGVXy6UfkyGJdosMFcQTv7b13vuwjTNsDx+K7I 10HXSccUCxvmHnKs+b2luvExagSdhTRRO90/SFWZBF06+qg9qN1zy/C3Ftkrngp5nhxr V8sTWdVpzCFMTc/7TXsYrLDpTyefZv7Lva5QGyGz/Omz23aVN65+8UHgA9x8Ve2cSdxB HLHg8qIxJETEwQQFsqrS5mOoePvNq0p1PMqCsqkJtT1KYOgMjrKaRTCmENuuRZ59fQLj 1Dag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MppmfOHL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m4-20020a50d7c4000000b0043da8aa23adsi9115943edj.474.2022.08.15.22.37.11; Mon, 15 Aug 2022 22:37:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MppmfOHL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234045AbiHPE63 (ORCPT + 99 others); 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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ibm,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 = 0, fdtlen = 0, ret; + int len = 0, fdtlen = 0; prop = of_get_property(dn, propname, &len); fdtprop = fdt_getprop(fdt, node_offset, propname, &fdtlen); if (fdtprop && !prop) - ret = fdt_delprop(fdt, node_offset, propname); + return fdt_delprop(fdt, node_offset, propname); else if (prop) - ret = fdt_setprop(fdt, node_offset, propname, prop, len); - - return ret; + return fdt_setprop(fdt, node_offset, propname, prop, len); + else + return -FDT_ERR_NOTFOUND; } static int update_pci_dma_nodes(void *fdt, const char *dmapropname)