From patchwork Mon May 17 14:02:25 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: 440137 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp1205910jac; Mon, 17 May 2021 08:45:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6/k+pK3AQ4vgP5quzOxKVV9po6/5l18pV9TeSjivABC8hQ65V0lDq/XclBlbBPTTBFIp+ X-Received: by 2002:a17:906:2b57:: with SMTP id b23mr561449ejg.294.1621266354784; Mon, 17 May 2021 08:45:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621266354; cv=none; d=google.com; s=arc-20160816; b=emKKOiFTYKrQBs6dSa3qt0rmwiUYqNvEHVE39RrAtyl4pGp01G3D1vad3kqrVue8Sl tUS9OxDiOiqwqrhbeQSsNueRMM3NoeLIU+tQV1kvE7owMFxVTExHbrQQz4q1ZuF1xbNW RNZKGv3ej1Qld3J9xi4IR8uFPbG1KQKFErC0uI9PKbTqPp0PEVNxrEW+8/Tk4qH0zEke gfcCXKIlj0PvlYsAL2FSsQsh08WzoKC+OIRzlgmdiQZMPbAmBAUvMEG31SGp1gMD9i6N zkRi5bAcPl/UhtNTE1BGnyYcZq4XUDjJmDIyHRnOnlPXuSz0kaoniDFNp1snpLgVsyHi 92eA== 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=07epYrvvzmeuHzl3QyX4DUBeBKRVuNO+hnacizTRikCdt1tdRp/LQqcGTWiySgCpP/ gnU8mDSSAWnggOXWEu34TnFp38xlIm96tMUbXz0nj2PqrrSB0Me7kXYy+LMQCM7sGMTe x5sIohbjVmYUHJXN80N7UQ2kQ5YeXMkgLqPW9gRS5fepJwI4kuBgL1r1JTlWSijLF31i Q8dPJ1jYfFzpzNp2ypiJe0/hnUGZKvV5k0AgHsWp+4Gyrz0bMXsuizcSf/1oALOXZX1m br8nXWhU10wf2nhIEsP7huc84p/6u+EjB34flPeyW9SRMK77h5vnqYtIekKf7Xf6ElnU 8Kjg== 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 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 o18si15073504edc.137.2021.05.17.08.45.54; Mon, 17 May 2021 08:45:54 -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=FlucrVZM; 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 S243615AbhEQPrI (ORCPT + 12 others); Mon, 17 May 2021 11:47:08 -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 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) {