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: a4574f63ed
("mm/memremap_pages: convert to 'struct range'")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20210508021913.1727-1-thunder.leizhen@huawei.com
Signed-off-by: Juergen Gross <jgross@suse.com>
This commit is contained in:
parent
970655aa9b
commit
dbc03e8158
|
@ -39,8 +39,10 @@ static int fill_list(unsigned int nr_pages)
|
||||||
}
|
}
|
||||||
|
|
||||||
pgmap = kzalloc(sizeof(*pgmap), GFP_KERNEL);
|
pgmap = kzalloc(sizeof(*pgmap), GFP_KERNEL);
|
||||||
if (!pgmap)
|
if (!pgmap) {
|
||||||
|
ret = -ENOMEM;
|
||||||
goto err_pgmap;
|
goto err_pgmap;
|
||||||
|
}
|
||||||
|
|
||||||
pgmap->type = MEMORY_DEVICE_GENERIC;
|
pgmap->type = MEMORY_DEVICE_GENERIC;
|
||||||
pgmap->range = (struct range) {
|
pgmap->range = (struct range) {
|
||||||
|
|
Loading…
Reference in New Issue