riscv: Drop const annotation for sp
authorKefeng Wang <wangkefeng.wang@huawei.com>
Wed, 17 Mar 2021 15:08:38 +0000 (23:08 +0800)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Fri, 2 Apr 2021 04:37:03 +0000 (21:37 -0700)
The const annotation should not be used for 'sp', or it will
become read only and lead to bad stack output.

Fixes: dec822771b01 ("riscv: stacktrace: Move register keyword to beginning of declaration")
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/kernel/stacktrace.c

index 3f893c9..2b3e0cb 100644 (file)
@@ -14,7 +14,7 @@
 
 #include <asm/stacktrace.h>
 
-register const unsigned long sp_in_global __asm__("sp");
+register unsigned long sp_in_global __asm__("sp");
 
 #ifdef CONFIG_FRAME_POINTER