Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3117378rwb; Mon, 15 Aug 2022 18:32:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR5L2XKYctqHgBiZsYqpIU5rbFd/YR1bmDr/axad/f6ZPQtAT7UQRv8AjWidWSwD/G4febst X-Received: by 2002:a17:90b:508a:b0:1f3:3a77:4fde with SMTP id rt10-20020a17090b508a00b001f33a774fdemr21058636pjb.130.1660613547274; Mon, 15 Aug 2022 18:32:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660613547; cv=none; d=google.com; s=arc-20160816; b=RbnhCHf9rqwBLG68u2a1OGFqhjPGsFxMUm8j8t8CZKcDqKEWLvdDJV+TnW1rSWNn5u eC9Ny3AiKzywNffcrfFfwTAYQWP5Wkeowbc3vHLaMpzdEUR9IlrZXe1bWgnjjeeFdjo8 1iYvEOyJng/Vi/hi4+FlseaJl6luNQUOgs+mwm+DWTM/1nHJ08ueLW8q/BfED5BjJ7BP PsugJ7UqYnu6iBgUdWwA6cxZII1t6S1Daj3uOyYhXJXaEEeWxg5RP2l+4Uu5/EtKEF1S FIQGZ998Q5x6vjMi8GMUEWDDgEmNYKai19g6Eh7rfIE4MvqIm7CUXxjzgd/64psSdpXR RLlQ== 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=H0V45magNuywGAqfKRvE4eVSohnycBdxg7f324hts+ZwKn4/CtDjHvcWrxDMNQEkML 6A2az9gLAmaGkeoCvP6RnH7kWy/U7fhWqph5OxH4N96/e/Pudo5cEPBZ38DnJpGVAqgC l7l5h8FqJcMEjm/spjjdlsACG6gVgsvpKMM9WEkF7XjB7iYmBLBuprCqG/Moy070l8YV Juf8Fp9ZkwX6rOk5RqU4e0EE4tw6PFjBmXkSsxu6MT6mWSQEY+HokdogKNuQxEoppTiC ExS942LCyOzHM5MLUu1PYM8Uy0y8StTKNwhsaS0pQp8Lx3xtWbHo29QoZOJAehJea8XD AzVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IdqOUL0w; 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 u8-20020a634548000000b0041ccbc553d9si11842823pgk.485.2022.08.15.18.32.16; Mon, 15 Aug 2022 18:32:27 -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=IdqOUL0w; 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 S1354651AbiHOXtN (ORCPT + 99 others); Mon, 15 Aug 2022 19:49:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353643AbiHOXma (ORCPT ); Mon, 15 Aug 2022 19:42:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B386D84EF0; Mon, 15 Aug 2022 13:13:46 -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 CE58060F0C; Mon, 15 Aug 2022 20:13:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6C81C433D6; Mon, 15 Aug 2022 20:13:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594425; bh=nOfKq7c1vjoucNhMxCONBAKa9x7dzyly5obHXmxWhyY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IdqOUL0wOlOJ8A6oyy+SFAZpiLEGyyFzOCrYdZTmwMBPFosYfAoSb5aU8vWR0xNfL /xQJ9hdCmxmjkRt91FicrPUvCpRDYprn07hcmQ8WzDx6XfAPJxAmN5kfBD+lv8nTCQ zBFAN8ZhOXFbkrcMmeD+q+qtef7mzPZvIfTz8X8k= 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.18 1086/1095] powerpc/kexec: Fix build failure from uninitialised variable Date: Mon, 15 Aug 2022 20:08:05 +0200 Message-Id: <20220815180513.963060377@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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)