From c2314cb2dd4140cb14b79a8139be34459777f421 Mon Sep 17 00:00:00 2001 From: Vasily Gorbik Date: Fri, 11 Sep 2020 11:40:21 +0200 Subject: [PATCH] s390/protvirt: support ultravisor without secure storage limit Avoid potential crash due to lack of secure storage limit. Check that max_sec_stor_addr is not 0 before adjusting vmalloc position. Signed-off-by: Vasily Gorbik --- arch/s390/kernel/uv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/s390/kernel/uv.c b/arch/s390/kernel/uv.c index 4233245737bd9..1a166a1119c0e 100644 --- a/arch/s390/kernel/uv.c +++ b/arch/s390/kernel/uv.c @@ -90,7 +90,8 @@ fail: void adjust_to_uv_max(unsigned long *vmax) { - *vmax = min_t(unsigned long, *vmax, uv_info.max_sec_stor_addr); + if (uv_info.max_sec_stor_addr) + *vmax = min_t(unsigned long, *vmax, uv_info.max_sec_stor_addr); } /* -- 2.30.2