From e1eac1947bae72eff74925b2fb82b93ded11ae6a Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Sun, 24 Jan 2021 20:08:40 +0100 Subject: 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 Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik --- arch/s390/kernel/vdso.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'arch/s390') diff --git a/arch/s390/kernel/vdso.c b/arch/s390/kernel/vdso.c index 7075459aed51..f06791c085e7 100644 --- a/arch/s390/kernel/vdso.c +++ b/arch/s390/kernel/vdso.c @@ -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); -- cgit