From patchwork Mon May 17 14:02:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 440132 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp1194092jac; Mon, 17 May 2021 08:31:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQagWCAnuDCopf+Gq77jzrdzk0AcMtd0KVTDaC82WpRFeQQLO4G/PFibsI6CCXHRdNZwWj X-Received: by 2002:a50:c09a:: with SMTP id k26mr719609edf.27.1621265512018; Mon, 17 May 2021 08:31:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621265512; cv=none; d=google.com; s=arc-20160816; b=QFPj224J9j9vgscyhTVik2mfRhUx0Jv/f9ZKK9Eaoxm/4YVjbkIwmCEvIX5JQfBTCU R35fX2t36caIqwtTXOZefKLgloBocH7AD7Z+v3dvzDJmjRp03JM3gUi1EKp7+ECck86D QfKJl+Jt7InZGGhzyqIAQKiX/l1UEqS2zF1IfD51hh91iqqooLvWpj7ZV/GZVwuJ+WM3 Q5QNQIj5/jpJyQettyj3tHJD1LBOJK6ZESqhpRnmQXSFM4eIYitQ2TJvKUgojqPLcSHK Wzt6Ux3a7QEhEkHd3Hwhch19HMNb/W+50qh93SkDN3xC6GqnRFQvZug24CLnRtXQVJDs QpKw== 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=iHmzc3CIxu8KTo0mH4OqEIVPvnRIyoqr0uCkPBiB04bM9dZKD9r0kpeyuGnj40nnHX MqGFAC/y0RPexCZmESlwyd2P5Wp9UgNe/T9YNiz9yueGfBrRJCQckvIRvQ+dKMolHEyT tBBcubsZU5soQ91b7J15iB9CuFtvf6aahH/MrCwtTfHhLonHuu4ZctmcNmiYljBsH32K 3K422ZtFqVuuuOoo2JR9aTMBiHbTRN/KdLV9o8v2dM2ejOr2PR0z5yL+2w81jhvIg5en 89NR2pjLPtJ9w36KK3gjyRI458EzNQRCaP9hw/StDY6lt1KSHWLJlrxZc5pEfo01ePlK RkEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ybLBR8bd; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 d26si16228318edr.567.2021.05.17.08.31.51; Mon, 17 May 2021 08:31:52 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=ybLBR8bd; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S244949AbhEQPdF (ORCPT + 12 others); Mon, 17 May 2021 11:33:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:51532 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343583AbhEQPbB (ORCPT ); Mon, 17 May 2021 11:31:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EBA7E613F4; Mon, 17 May 2021 14:38:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621262291; bh=fngY5Z8pt3dkBwALJzRZGtAqNPMwfFVcNbPbxtMCDN4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ybLBR8bdoxLjAmXfC2OKExo6h3MbOZgM1ihlUy+tcn/f0IBGE0H0nHw4dttl9WTEz YXaC9A45GIG4NmwpMlP5x8Dn4Ci8cOCCq4sv95TMDg7JrfqCLTpew6YcymsJI+BMcW 06tvNQA22cywYm/D/H3WWqyffS0E+oMHbfJjEqYE= 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.11 258/329] xen/unpopulated-alloc: fix error return code in fill_list() Date: Mon, 17 May 2021 16:02:49 +0200 Message-Id: <20210517140310.835517390@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.043055203@linuxfoundation.org> References: <20210517140302.043055203@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@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(-) -- 2.30.2 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) {