aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/unpopulated-alloc.c
diff options
context:
space:
mode:
authorZhen Lei <[email protected]>2021-05-08 02:19:13 +0000
committerJuergen Gross <[email protected]>2021-05-10 07:42:25 +0000
commitdbc03e81586fc33e4945263fd6e09e22eb4b980f (patch)
treeabb84c42576390514654c5244695bdd7ff46fba2 /drivers/xen/unpopulated-alloc.c
parentxen/gntdev: fix gntdev_mmap() error exit path (diff)
downloadkernel-dbc03e81586fc33e4945263fd6e09e22eb4b980f.tar.gz
kernel-dbc03e81586fc33e4945263fd6e09e22eb4b980f.zip
xen/unpopulated-alloc: fix error return code in fill_list()
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 <[email protected]> Signed-off-by: Zhen Lei <[email protected]> Reviewed-by: Juergen Gross <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Juergen Gross <[email protected]>
Diffstat (limited to 'drivers/xen/unpopulated-alloc.c')
-rw-r--r--drivers/xen/unpopulated-alloc.c4
1 files changed, 3 insertions, 1 deletions
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) {