lkml.org 
[lkml]   [2019]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[tip:x86/boot] x86/boot/KASLR: Always return a value from process_mem_region
Commit-ID:  d9a9db4625362b062ee40c9065a06307f7b5c0c9
Gitweb: https://git.kernel.org/tip/d9a9db4625362b062ee40c9065a06307f7b5c0c9
Author: Louis Taylor <louis@kragniz.eu>
AuthorDate: Sat, 2 Mar 2019 18:49:29 +0000
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 6 Mar 2019 21:29:23 +0100

x86/boot/KASLR: Always return a value from process_mem_region

When compiling with -Wreturn-type, clang warns:

arch/x86/boot/compressed/kaslr.c:704:1: warning: control may reach end of
non-void function [-Wreturn-type]

This function's return statement should have been placed outside the

Fixes: 690eaa532057 ("x86/boot/KASLR: Limit KASLR to extract the kernel in immovable memory only")
Signed-off-by: Louis Taylor <louis@kragniz.eu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Cc: bp@alien8.de
Cc: hpa@zytor.com
Cc: fanc.fnst@cn.fujitsu.com
Cc: bhe@redhat.com
Cc: kirill.shutemov@linux.intel.com
Cc: jflat@chromium.org
Link: https://lkml.kernel.org/r/20190302184929.28971-1-louis@kragniz.eu
---
arch/x86/boot/compressed/kaslr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
index fa0332dda9f2..2e53c056ba20 100644
--- a/arch/x86/boot/compressed/kaslr.c
+++ b/arch/x86/boot/compressed/kaslr.c
@@ -697,8 +697,8 @@ static bool process_mem_region(struct mem_vector *region,
return 1;
}
}
- return 0;
#endif
+ return 0;
}

#ifdef CONFIG_EFI
\
 
 \ /
  Last update: 2019-03-06 21:35    [W:0.076 / U:1.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site