xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] xen/unpopulated-alloc: fix error return code in fill_list()
@ 2021-05-08  2:19 Zhen Lei
  2021-05-10  7:26 ` Juergen Gross
  2021-05-10  9:26 ` Juergen Gross
  0 siblings, 2 replies; 3+ messages in thread
From: Zhen Lei @ 2021-05-08  2:19 UTC (permalink / raw)
  To: Boris Ostrovsky, Juergen Gross, Stefano Stabellini,
	Andrew Morton, Dan Carpenter, Dan Williams, xen-devel,
	linux-kernel
  Cc: Zhen Lei

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 <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 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.25.1




^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-10  9:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-08  2:19 [PATCH 1/1] xen/unpopulated-alloc: fix error return code in fill_list() Zhen Lei
2021-05-10  7:26 ` Juergen Gross
2021-05-10  9:26 ` Juergen Gross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).