diff options
author | David Hildenbrand <[email protected]> | 2020-07-22 11:45:53 +0200 |
---|---|---|
committer | Heiko Carstens <[email protected]> | 2020-07-27 10:33:46 +0200 |
commit | c00f05a92424c7788fdbf0909b823f8027596d66 (patch) | |
tree | 7ab4d5c928e9816f40faac1e4ac49839e135cfb0 | |
parent | 9ec8fa8dc331be6b63726be696b2b21d0031a09b (diff) |
s390/vmemmap: cleanup when vmemmap_populate() fails
Cleanup what we partially added in case vmemmap_populate() fails. For
vmem, this is already handled by vmem_add_mapping().
Cc: Vasily Gorbik <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Cc: Gerald Schaefer <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Heiko Carstens <[email protected]>
-rw-r--r-- | arch/s390/mm/vmem.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c index 43fe1e2eb90e..be32a38bb91f 100644 --- a/arch/s390/mm/vmem.c +++ b/arch/s390/mm/vmem.c @@ -332,8 +332,13 @@ static void vmem_remove_range(unsigned long start, unsigned long size) int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node, struct vmem_altmap *altmap) { + int ret; + /* We don't care about the node, just use NUMA_NO_NODE on allocations */ - return add_pagetable(start, end, false); + ret = add_pagetable(start, end, false); + if (ret) + remove_pagetable(start, end, false); + return ret; } void vmemmap_free(unsigned long start, unsigned long end, |