[PATCH 2/2] s390x: Assume zero value of OS_INFO pointer is valid

Alexander Gordeev agordeev at linux.ibm.com
Mon Sep 30 09:12:58 PDT 2024


An assumption that zero value of OS_INFO pointer is not valid
leads to a failure of --mem-usage argument against /proc/kcore:

s390x_init_vm: Can't get s390x os_info ptr.

Reported-by: Philipp Rudo <prudo at redhat.com>
Fixes: 9d58c2630c71 ("s390x: uncouple virtual and physical address spaces")
Signed-off-by: Alexander Gordeev <agordeev at linux.ibm.com>
---
 arch/s390x.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/s390x.c b/arch/s390x.c
index 4a993be..f9a055d 100644
--- a/arch/s390x.c
+++ b/arch/s390x.c
@@ -156,8 +156,7 @@ static int s390x_init_vm(void)
 	struct os_info os_info;
 	ulong addr;
 
-	if (!readmem(PADDR, S390X_LC_OS_INFO, &addr,
-			sizeof(addr)) || !addr) {
+	if (!readmem(PADDR, S390X_LC_OS_INFO, &addr, sizeof(addr))) {
 		ERRMSG("Can't get s390x os_info ptr.\n");
 		return FALSE;
 	}
-- 
2.43.0




More information about the kexec mailing list