diff options
author | David Hildenbrand <david@redhat.com> | 2020-07-22 11:45:53 +0200 |
---|---|---|
committer | Heiko Carstens <hca@linux.ibm.com> | 2020-07-27 10:33:46 +0200 |
commit | c00f05a92424c7788fdbf0909b823f8027596d66 (patch) | |
tree | 7ab4d5c928e9816f40faac1e4ac49839e135cfb0 | |
parent | 9ec8fa8dc331be6b63726be696b2b21d0031a09b (diff) | |
download | linux-c00f05a92424c7788fdbf0909b823f8027596d66.tar.bz2 |
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 <gor@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20200722094558.9828-5-david@redhat.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
-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, |