From 2f09c2ea6c649cb010e0782aed3c96108e693cff Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Wed, 8 Feb 2023 19:16:45 +0100 Subject: [PATCH] Revert "s390/mem_detect: do not update output parameters on failure" This reverts commit cbc29f107e51b1cc7d1e7b0bbe0691a1224205f1. Get rid of the following smatch warnings: arch/s390/include/asm/mem_detect.h:86 get_mem_detect_end() error: uninitialized symbol 'end'. arch/s390/include/asm/mem_detect.h:86 get_mem_detect_end() error: uninitialized symbol 'end'. arch/s390/boot/vmem.c:256 setup_vmem() error: uninitialized symbol 'start'. arch/s390/boot/vmem.c:258 setup_vmem() error: uninitialized symbol 'end'. Note that there is no bug in the code. This is purely to silence smatch. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Heiko Carstens --- arch/s390/include/asm/mem_detect.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/s390/include/asm/mem_detect.h b/arch/s390/include/asm/mem_detect.h index 08798dd..decd8c4 100644 --- a/arch/s390/include/asm/mem_detect.h +++ b/arch/s390/include/asm/mem_detect.h @@ -40,8 +40,11 @@ void add_mem_detect_block(u64 start, u64 end); static inline int __get_mem_detect_block(u32 n, unsigned long *start, unsigned long *end) { - if (n >= mem_detect.count) + if (n >= mem_detect.count) { + *start = 0; + *end = 0; return -1; + } if (n < MEM_INLINED_ENTRIES) { *start = (unsigned long)mem_detect.entries[n].start; -- 2.7.4