From db4e0b1f6d97b53433a66cf58d58e09f578c3e6b Mon Sep 17 00:00:00 2001 From: Erwei Deng Date: Tue, 12 Apr 2022 10:32:50 +0800 Subject: [PATCH 1/2] src: fix a compilation error of stack checking Missing a local variable to get stack address. Fixes: 48a2d890(src: use stack_trace_save_tsk() to check stack if CONFIG_ARCH_STACKWALK is enabled) Reported-by: Shanpei Chen Signed-off-by: Erwei Deng --- src/stack_check.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/stack_check.h b/src/stack_check.h index d2294a2..082e757 100644 --- a/src/stack_check.h +++ b/src/stack_check.h @@ -60,6 +60,7 @@ static int stack_check_fn(unsigned long *entries, unsigned int nr_entries, bool for (i = 0; i < nr_entries; i++) { int idx; + unsigned long address = entries[i]; idx = bsearch(func_addr, 0, NR_INTERFACE_FN - 1, address); if (idx == -1) -- Gitee From f8552a06de9f45c0b007011dee56415a99505fa2 Mon Sep 17 00:00:00 2001 From: Erwei Deng Date: Tue, 12 Apr 2022 10:38:24 +0800 Subject: [PATCH 2/2] src: remove unused variable 'ret' in stack_check.h Fixes: 48a2d890(src: use stack_trace_save_tsk() to check stack if CONFIG_ARCH_STACKWALK is enabled) Reported-by: Shanpei Chen Signed-off-by: Erwei Deng --- src/stack_check.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stack_check.h b/src/stack_check.h index 082e757..67aaaa9 100644 --- a/src/stack_check.h +++ b/src/stack_check.h @@ -46,7 +46,7 @@ static void stack_check_init(void) static int stack_check_fn(unsigned long *entries, unsigned int nr_entries, bool install) { - int i, ret; + int i; unsigned long *func_addr; unsigned long *func_size; -- Gitee