aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/debug.c
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2020-03-31 05:57:23 -0400
committerHeiko Carstens <heiko.carstens@de.ibm.com>2020-06-23 14:05:55 +0200
commit827c4913923e0b441ba07ba4cc41e01181102303 (patch)
tree01f68e4352a1658e4517f319980ebc671fe9137b /arch/s390/kernel/debug.c
parents390/kasan: fix early pgm check handler execution (diff)
downloadlinux-dev-827c4913923e0b441ba07ba4cc41e01181102303.tar.xz
linux-dev-827c4913923e0b441ba07ba4cc41e01181102303.zip
s390/debug: avoid kernel warning on too large number of pages
When specifying insanely large debug buffers a kernel warning is printed. The debug code does handle the error gracefully, though. Instead of duplicating the check let us silence the warning to avoid crashes when panic_on_warn is used. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/debug.c')
-rw-r--r--arch/s390/kernel/debug.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index 636446003a06..263075a1af36 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -198,9 +198,10 @@ static debug_entry_t ***debug_areas_alloc(int pages_per_area, int nr_areas)
if (!areas)
goto fail_malloc_areas;
for (i = 0; i < nr_areas; i++) {
+ /* GFP_NOWARN to avoid user triggerable WARN, we handle fails */
areas[i] = kmalloc_array(pages_per_area,
sizeof(debug_entry_t *),
- GFP_KERNEL);
+ GFP_KERNEL | __GFP_NOWARN);
if (!areas[i])
goto fail_malloc_areas2;
for (j = 0; j < pages_per_area; j++) {