author: Zhen Lei <thunder.leizhen@huawei.com> 2021-05-08 10:19:13 +0800
committer: Juergen Gross <jgross@suse.com> 2021-05-10 09:42:25 +0200
commit: dbc03e81586fc33e4945263fd6e09e22eb4b980f
parent: 970655aa9b42461f8394e4457307005bdeee14d9
Commit Summary:
Diffstat:
1 file changed, 3 insertions, 1 deletion
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) {