From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AF71AC433EF for ; Fri, 10 Dec 2021 01:03:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=EDK3EdwiV4Os2eHXY1xO+/cDF3BEUbabUa//1qzb2Po=; b=geoDbSfTS+6oJE ypLsT2//SHfzgmUQO+eQSi4Jg30njIy/ZCb6Y5wRtR2LMHwKUZKhAO6HPaNPLX4n3V1Janv7I+5Gb lduePn1tsAiLlEXH1+/632PnnQxglsyLufwvy57CjTl12vLnRRUHsEVfvK4hukRgmIZpG5cdox7gI CCufgu7c5ev5wLg9nT8phhVrpujXJ3TBe8l+C+BAeSsMSFS5txAM41u6hE7qKVSdJEUXEyUjBZBUl AKgRM1Pwz4A5ZwgfdFz4dSoJ4ngtafMzBj71GncwL422ToCQXDo/a2gmr5Quf5JKvlNQ6uDcDssHR T/FOZ1lrRagp82XxRYZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvUI0-000V8S-7R; Fri, 10 Dec 2021 01:01:32 +0000 Received: from linux.microsoft.com ([13.77.154.182]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvUHw-000V7p-7R for linux-arm-kernel@lists.infradead.org; Fri, 10 Dec 2021 01:01:29 +0000 Received: from localhost.localdomain (c-73-42-176-67.hsd1.wa.comcast.net [73.42.176.67]) by linux.microsoft.com (Postfix) with ESMTPSA id A682720B7179; Thu, 9 Dec 2021 17:01:25 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A682720B7179 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1639098085; bh=/EvGK3Q5FFfSXMyeMql3XihYjIuKH4bKdyx4YUb6kp4=; h=From:To:Cc:Subject:Date:From; b=nJ/11WvE0l38FgsHMExecg1nxN3Co9BaHUTHbRglTDzJGhqisdxpBbPq/7WxcpmqZ ae6uXR53NOvZXwF4mxrnlEa1ywybC07TlD3eys75fEo2bzk7y+6HkjsqN+jDu5rx0E 6jkfwD02C55axa8+rGdZw7H3a/9EnrYMxYBjuBoM= From: Lakshmi Ramasubramanian To: dan.carpenter@oracle.com, robh@kernel.org, catalin.marinas@arm.com, will@kernel.org Cc: kbuild@lists.01.org, lkp@intel.com, kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, bauerman@linux.ibm.com, nramas@linux.microsoft.com, qiuguorui1@huawei.com Subject: [PATCH] arm64: kexec: Fix missing error code 'ret' warning in load_other_segments() Date: Thu, 9 Dec 2021 17:01:21 -0800 Message-Id: <20211210010121.101823-1-nramas@linux.microsoft.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211209_170128_374095_78C8DA75 X-CRM114-Status: UNSURE ( 9.13 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Since commit ac10be5cdbfa ("arm64: Use common of_kexec_alloc_and_setup_fdt()"), smatch reports the following warning: arch/arm64/kernel/machine_kexec_file.c:152 load_other_segments() warn: missing error code 'ret' Return code is not set to an error code in load_other_segments() when of_kexec_alloc_and_setup_fdt() call returns a NULL dtb. This results in status success (return code set to 0) being returned from load_other_segments(). Set return code to -EINVAL if of_kexec_alloc_and_setup_fdt() returns NULL dtb. Signed-off-by: Lakshmi Ramasubramanian Reported-by: kernel test robot Reported-by: Dan Carpenter Fixes: ac10be5cdbfa ("arm64: Use common of_kexec_alloc_and_setup_fdt()") --- arch/arm64/kernel/machine_kexec_file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/kernel/machine_kexec_file.c b/arch/arm64/kernel/machine_kexec_file.c index 63634b4d72c1..59c648d51848 100644 --- a/arch/arm64/kernel/machine_kexec_file.c +++ b/arch/arm64/kernel/machine_kexec_file.c @@ -149,6 +149,7 @@ int load_other_segments(struct kimage *image, initrd_len, cmdline, 0); if (!dtb) { pr_err("Preparing for new dtb failed\n"); + ret = -EINVAL; goto out_err; } -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel