Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp601573pxj; Tue, 18 May 2021 10:02:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7zKLyx5F+ysKLMMycc8wTniNJgrvTsLVf2xBJInz9m0J4ULiojhspKGDZOPE5ivSXgqB1 X-Received: by 2002:a17:906:3883:: with SMTP id q3mr6928506ejd.4.1621357338844; Tue, 18 May 2021 10:02:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621357338; cv=none; d=google.com; s=arc-20160816; b=mo1GeMs9zqMpql0r7//FxG0gCEJyRlq6jrhekJ3XFyBWtB/IbzEkHAMF4Cx3dZwSYq f5KjY1kTWs4xISBFe6qCCtxmZ6c5W6Hy6vGnFabRHgL6qd0nERxSU1IFNmtQ1aWaJUxM eKlJfagi8Sw7rBsZLreChE7D3SKnMRgIbT/zXpMwKev1M6qmkJLWVadpEcjyAwRGud7K vkm7JLWwTig/N9uH30DGYh+xXcU65k8ow4SHmnMYqbJKladuPv4EXkr+ArSkoFaIBTYg w8fCO7tBfiemI73wpdV7ZgQJnP+snIbrCEioygckNwxYtfDpx38mlLbvq6FzhC/B9Fiz khAw== 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=zW+nrnAK3bWNRUYc7pumsK4HAb8fPpcxwkv62nQol+k=; b=ewuoBcu4wPhb8CWVbqG84mpV1e+NTTEHiI5qVw7jbTtczBIxlBVEBsSnjov7yxeKTe QsULatPPy2f/jjiOUZwtVdg6yoAtbu1AoxTLbbGFuLzz57fNZwdDYs/ZW8AGw5mn+K+I tsQB2EHAQZuu8ZRhN0uVq9h4L8m298eZzCVdOfC63oF2b2VyD87X1OtSRacUNeG2sBr2 giS6PFXbMiabbcPsVFANdyxLKrAy0IW6mxp/kqcB1eCh+Q8g3JIeDVKy+vAqqLKMc86p hdlEB+UAsiaG/klG4yM363HFA35M3DIJQL+t9kXFq455QrhLvp6Mrf7RvmFSjOdjqqIg mxNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FlucrVZM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id du20si3089618ejc.738.2021.05.18.10.01.47; Tue, 18 May 2021 10:02:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FlucrVZM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1344907AbhEQQHL (ORCPT + 99 others); Mon, 17 May 2021 12:07:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:52166 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344274AbhEQPoL (ORCPT ); Mon, 17 May 2021 11:44:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8ADEA61D19; Mon, 17 May 2021 14:43:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621262591; bh=fngY5Z8pt3dkBwALJzRZGtAqNPMwfFVcNbPbxtMCDN4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FlucrVZMS5iRoKge+5DdM3lMNILQKUDU2L1T8ilq7/diRJljRM02QwCT6R2I4PIyQ vOJnUyKBe1WGrQrRjv7RIdQseg3/wLXza7mYoMplmn4P4l81QGFFbuyr9W2Ucb2qUy Stuk8J7cnELXfxb0ZXw/jY3EAcV0PBEVheYUl03I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Zhen Lei , Juergen Gross , Sasha Levin Subject: [PATCH 5.10 220/289] xen/unpopulated-alloc: fix error return code in fill_list() Date: Mon, 17 May 2021 16:02:25 +0200 Message-Id: <20210517140312.562853920@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhen Lei [ Upstream commit dbc03e81586fc33e4945263fd6e09e22eb4b980f ] Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: a4574f63edc6 ("mm/memremap_pages: convert to 'struct range'") Reported-by: Hulk Robot Signed-off-by: Zhen Lei Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20210508021913.1727-1-thunder.leizhen@huawei.com Signed-off-by: Juergen Gross Signed-off-by: Sasha Levin --- drivers/xen/unpopulated-alloc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/xen/unpopulated-alloc.c b/drivers/xen/unpopulated-alloc.c index e64e6befc63b..87e6b7db892f 100644 --- a/drivers/xen/unpopulated-alloc.c +++ b/drivers/xen/unpopulated-alloc.c @@ -39,8 +39,10 @@ static int fill_list(unsigned int nr_pages) } pgmap = kzalloc(sizeof(*pgmap), GFP_KERNEL); - if (!pgmap) + if (!pgmap) { + ret = -ENOMEM; goto err_pgmap; + } pgmap->type = MEMORY_DEVICE_GENERIC; pgmap->range = (struct range) { -- 2.30.2