Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp115629pxj; Mon, 17 May 2021 22:36:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzn0qe+Lj7n/TiFednoJQBnElsAtmJ5JwlgCV/eA2C3X60ZGhTaeaVhWxGaFIgAoKRY002C X-Received: by 2002:a05:6e02:12b0:: with SMTP id f16mr2637900ilr.132.1621316213603; Mon, 17 May 2021 22:36:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621316213; cv=none; d=google.com; s=arc-20160816; b=rYeXpbo7kiKXQF705gmqV2F45/PJwLsN3asfXBddfeAed1Jxm7lfILRG6pf2VBgtUY q1Ta0RWeiGWd5MDUtk4Un1sNEsxhy0m8MGnoz63jzrCH3F719FriFtwZoAaIJHRJI0uU RSws6qYa8F+Td8/E1yEV8oPlzl/08h16DEG8qFhZCqQoZ+Gn4aoir4A3MNfA8bYHoDo2 p3Fg1eJHfYRMHwO8P4gfJV0Itk1i5OsegXdcP9dsWKRYTMw2a/QD8tQWK979wDkOEmQU 3WsPaFmYd6QE7UgBw7NBm/Tpi/ipcsIKtkoN+6Gy4Fg9WuBL8YSCOCZJ0TGDKp0v1OhD f3Fg== 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=rmvJn8FhIFBnP+Jsjmzx8alBYLETKx9qv3SKa32JpmPdfItRozPH9YEWOe/jv2gZ8j 50zyvXMPuVMLUkMYnBDpvHiAWqXq0w/pH1EEy44Cs804PNbAEX7ZfnmD4zrDScTLHuaJ qB6j2g9M3t8DLAfUTBPRvy+sK0P9ahWEeBNyDnEeoFkxDI3e2QccCPyHIgM5sF7Xce9k KJ+O74AlV3Pk8hib2tetvf3p3orDDBYl5HJTyGFa0h3geXM2nF0HSAI0GOUx3X3G1LQ1 aS6yPToV6tdA+eVXwWbg1aegspTo6bf44GltHZg9QgrspYQ6iUs/A3KrVayLjr2PhUXZ +7fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=W4jCnL4z; 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 j1si18966073ilo.38.2021.05.17.22.36.40; Mon, 17 May 2021 22:36:53 -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=W4jCnL4z; 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 S240378AbhEQOre (ORCPT + 99 others); Mon, 17 May 2021 10:47:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:34024 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240924AbhEQOjV (ORCPT ); Mon, 17 May 2021 10:39:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A5AE16193A; Mon, 17 May 2021 14:18:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621261111; bh=fngY5Z8pt3dkBwALJzRZGtAqNPMwfFVcNbPbxtMCDN4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W4jCnL4zh/UPR9S+LKrduebgELYomGlIahNPV6PhPGviv+y1lLrO6LlNnfABWGRWV Is6CSpAB2n3qDNrlXBY3p0sw60CDKDPArZ/YBtw9YB+klh9fN7qxY2Yt4JVcPbqA2b LsuYQpwPFUICl/Mgiaj3xmdOfohEXmfDVmDseqPA= 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.12 283/363] xen/unpopulated-alloc: fix error return code in fill_list() Date: Mon, 17 May 2021 16:02:29 +0200 Message-Id: <20210517140312.174948868@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@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