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 3A98FC433F5 for ; Thu, 9 Dec 2021 16:34:32 +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:References:In-Reply-To: Date:Cc:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MB4aFFZdH3nOour7y2iG/CpQaIvoOS9OUFul75O3RCg=; b=fmqqMJxrRzfZEp g6yS5DccUT4Kh96TSgcXOuHrT1dTU8b3eiGs/sZ6Hs7ty0w+RoYZrY2UxIVpdk76+QmfDGILqBZ8z Jsvor6TdN/hV14IjU+AGpumnIHqFAOvslb9JRIdMK0zdM+8ugBlUg+2nJy/K9Eo4+/T2lNUtwaPK3 TKh7uk9OrQWgpauOFE+ijlp1FNYcL9xb4GOYZ/OySYTQSwYXHrejMQP7SxBxfbWTNm3WWVsSmYOhK SpoJyjTJBko6QuiLHkyZNzEE4nVHAWVFagPxPwsn9QpxfRNCvhowRIQWLPmrfwquwRFnox4rxocX9 tWn7vxLL2Cl//3JNEkmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvMLy-00Gfyb-3w; Thu, 09 Dec 2021 16:33:06 +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 1mvMLt-00GfxD-Lm for linux-arm-kernel@lists.infradead.org; Thu, 09 Dec 2021 16:33:04 +0000 Received: from nramas-ThinkStation-P330 (c-73-42-176-67.hsd1.wa.comcast.net [73.42.176.67]) by linux.microsoft.com (Postfix) with ESMTPSA id F349E20B7179; Thu, 9 Dec 2021 08:32:59 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com F349E20B7179 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1639067580; bh=N3wpQ5OLnIzxXcnsuI1kbDFWKuA1aIQDkbQuBarQopw=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=Fj/fROnNZjTIOKMcjACq+Rws/AS2Kdzlmi+tmOIw49UIRVqYvhuUog0qTewV7H4l4 GkWYWfEQsv09BauGj9qBdBJ53jUKXjZv7eLOOl9wKJU+uqH8QATzUOF2NZDcQGyXB3 62pxqEM+WsKCrZL1ZmSgoBlIixaUBNha6gZXIT9c= Message-ID: Subject: Re: [PATCH] arm64: kexec: Fix missing error code 'ret' warning in load_other_segments() From: Lakshmi Ramasubramanian To: Catalin Marinas Cc: dan.carpenter@oracle.com, robh@kernel.org, will@kernel.org, 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, qiuguorui1@huawei.com Date: Thu, 09 Dec 2021 08:32:59 -0800 In-Reply-To: References: <20211209004522.91926-1-nramas@linux.microsoft.com> User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211209_083301_824423_0E07B7A4 X-CRM114-Status: GOOD ( 15.49 ) 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 Hi Catalin, On Thu, 2021-12-09 at 09:08 +0000, Catalin Marinas wrote: > On Wed, Dec 08, 2021 at 04:45:22PM -0800, Lakshmi Ramasubramanian > wrote: > > > > Set return code to -ENOMEM if of_kexec_alloc_and_setup_fdt() > > returns > > NULL dtb. > > > > > > @@ -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; > > } > > Above the 'if' block we have: > > dtb = of_kexec_alloc_and_setup_fdt(image, initrd_load_addr, > initrd_len, cmdline, 0); > > Looking at this function, it has several ways to fail, not just on > allocation. However, we assume above that it's always -ENOMEM. We > could > do like powerpc and use -EINVAL as more likely than allocation > failure > or change of_kexec_alloc_and_setup_fdt() to return ERR_PTR() and we > use > that. The latter would be my preferred option, though it probably > doesn't matter much. The second best would be -EINVAL. I'll change the error code to -EINVAL and post an updated patch. thanks, -lakshmi _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel