mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
xen/unpopulated-alloc: fix error return code in fill_list()
[ Upstream commitdbc03e8158] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0581225726
commit
1d8d7e02f6
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user