summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2020-07-22 11:45:53 +0200
committerHeiko Carstens <hca@linux.ibm.com>2020-07-27 10:33:46 +0200
commitc00f05a92424c7788fdbf0909b823f8027596d66 (patch)
tree7ab4d5c928e9816f40faac1e4ac49839e135cfb0 /arch
parent9ec8fa8dc331be6b63726be696b2b21d0031a09b (diff)
downloadlinux-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>
Diffstat (limited to 'arch')
-rw-r--r--arch/s390/mm/vmem.c7
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,