s390/vdso: remove BUG_ON()

Handle allocation error gracefully and simply disable vdso instead of
leaving the system in an undefined state.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
This commit is contained in:
Heiko Carstens 2021-01-24 20:08:40 +01:00 committed by Vasily Gorbik
parent ea44de691e
commit e1eac1947b
1 changed files with 4 additions and 1 deletions

View File

@ -175,7 +175,10 @@ static int __init vdso_init(void)
/* Make sure pages are in the correct state */
vdso64_pagelist = kcalloc(vdso64_pages + 1, sizeof(struct page *),
GFP_KERNEL);
BUG_ON(vdso64_pagelist == NULL);
if (!vdso64_pagelist) {
vdso_enabled = 0;
return -ENOMEM;
}
for (i = 0; i < vdso64_pages - 1; i++) {
struct page *pg = virt_to_page(vdso64_kbase + i*PAGE_SIZE);
get_page(pg);