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 6AB04C433F5 for ; Thu, 9 Dec 2021 00:47:35 +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=tIQb7ZSRb1iVpoVx1xzJauPgiyldg4oX9BLX4Lh77LA=; b=EjDg/XS//UTSjv 46TlhY4hjjgLy9WqeSKHkR/mVwYRNkGHIQI1+CcRMIctyqqmhRhEY7O954q9Y1YiDZB8iEm8n+pfV wMn5gp7PcENiIczRDHkRoMz+0fW5Z1gSoHmvqU1TBlBUcR2v+8RxOakAm0MoxUG1BKKt8PafBVc1T 3vzZJo28fXaUp9Ax+zn0vGZF5QbIV2/LwaAoPJmoU9C8Q+iL2GwcW1iH7tCxkVELeLvkM/tt4bH1K xL65cbRqUndueH1DQL4OvjhdYe13rCDInK9W6vl4rWTmBZAF1vuSoP4zDHmXmT4gKAl8mFjQbcNIn hZeWqIBD6IUxG3pfFKRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mv7Z2-00Ec4C-Fh; Thu, 09 Dec 2021 00:45:36 +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 1mv7Yy-00Ec3N-OY for linux-arm-kernel@lists.infradead.org; Thu, 09 Dec 2021 00:45:34 +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 0AFF020B7179; Wed, 8 Dec 2021 16:45:29 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 0AFF020B7179 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1639010729; bh=1NWJACmJQESTJLrrzBjHqGWkCTZYTClOB0+wV+KLjdU=; h=From:To:Cc:Subject:Date:From; b=k5C/UVeRkIhzGR9w4exUVCWUOrfHxyaD5SffqHEZvk19SDtRedanUrzs2/l8e6K8/ 2SvOmXPoCG/F+nRSNhRCpt+P2xYg3mCHKvq1GRwYQOxIfFaWuioFb3+72QelrwL/66 zq8lwvAaFPsHfgDtC7tsRSHEnpL7U0EWS/WdIXpU= 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: Wed, 8 Dec 2021 16:45:22 -0800 Message-Id: <20211209004522.91926-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-20211208_164532_850150_4BC49327 X-CRM114-Status: UNSURE ( 9.04 ) 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 -ENOMEM 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()") --- Patch created in dt/next branch in git repo https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git 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..04d072885e64 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 = -ENOMEM; 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