xen/unpopulated-alloc: fix error return code in fill_list()
PATCH 1/1 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]>
--- drivers/xen/unpopulated-alloc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/xen/unpopulated-alloc.c +3 -1
@@ -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 ) {
Signature · 1 line
2.25.1
Quoted 6 lines · 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 <[email protected]>Signed-off-by Zhen Lei <[email protected]>
Reviewed-by Juergen Gross <[email protected]>
Juergen
Quoted 6 lines · 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 <[email protected]>Signed-off-by Zhen Lei <[email protected]>
Pushed to xen/tip.git for-linus-5.13b
Juergen