summaryrefslogtreecommitdiff
path: root/arch/s390
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2021-01-24 20:08:40 +0100
committerVasily Gorbik <gor@linux.ibm.com>2021-02-09 15:57:05 +0100
commite1eac1947bae72eff74925b2fb82b93ded11ae6a (patch)
tree0e256c2a8b38d168f2fda39b267194318311bed4 /arch/s390
parentea44de691ebad701c849b174dabd376ed6d7d1ae (diff)
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>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/vdso.c5
1 files changed, 4 insertions, 1 deletions
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);