Skip to content

Commit dbc03e8

Browse files
Zhen Leijgross1
authored andcommitted
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: a4574f6 ("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]>
1 parent 970655a commit dbc03e8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/xen/unpopulated-alloc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ static int fill_list(unsigned int nr_pages)
3939
}
4040

4141
pgmap = kzalloc(sizeof(*pgmap), GFP_KERNEL);
42-
if (!pgmap)
42+
if (!pgmap) {
43+
ret = -ENOMEM;
4344
goto err_pgmap;
45+
}
4446

4547
pgmap->type = MEMORY_DEVICE_GENERIC;
4648
pgmap->range = (struct range) {

0 commit comments

Comments
 (0)