Skip to content

Commit c00f05a

Browse files
davidhildenbrandhcahca
authored andcommitted
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]>
1 parent 9ec8fa8 commit c00f05a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

arch/s390/mm/vmem.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,13 @@ static void vmem_remove_range(unsigned long start, unsigned long size)
332332
int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
333333
struct vmem_altmap *altmap)
334334
{
335+
int ret;
336+
335337
/* We don't care about the node, just use NUMA_NO_NODE on allocations */
336-
return add_pagetable(start, end, false);
338+
ret = add_pagetable(start, end, false);
339+
if (ret)
340+
remove_pagetable(start, end, false);
341+
return ret;
337342
}
338343

339344
void vmemmap_free(unsigned long start, unsigned long end,

0 commit comments

Comments
 (0)