From: Heiko Carstens Date: Sun, 24 Jan 2021 19:08:40 +0000 (+0100) Subject: s390/vdso: remove BUG_ON() X-Git-Tag: v5.15~1740^2~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e1eac1947bae72eff74925b2fb82b93ded11ae6a;p=platform%2Fkernel%2Flinux-starfive.git 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 --- diff --git a/arch/s390/kernel/vdso.c b/arch/s390/kernel/vdso.c index 7075459..f06791c 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);