Commit c00f05a9 authored by David Hildenbrand's avatar David Hildenbrand Committed by Heiko Carstens

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: default avatarDavid Hildenbrand <david@redhat.com>
Message-Id: <20200722094558.9828-5-david@redhat.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent 9ec8fa8d
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment