mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
9ec8fa8dc3
commit
c00f05a924
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue