From d4d06c1e2d01cd171fa0561c4d979262ef11a99f Mon Sep 17 00:00:00 2001 From: Ken Gordon Date: Tue, 15 Sep 2020 11:22:36 +0000 Subject: [PATCH] Update commenst in cpu.c. Fix bug in linked list handling in signal.c. Would have been an issue once more that one signal was in the task's queue. --- arch/lkl/kernel/cpu.c | 2 ++ arch/lkl/kernel/signal.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/lkl/kernel/cpu.c b/arch/lkl/kernel/cpu.c index a41bdfd5bfb190..5ce2e75bb32f7e 100644 --- a/arch/lkl/kernel/cpu.c +++ b/arch/lkl/kernel/cpu.c @@ -160,6 +160,8 @@ void lkl_cpu_put(void) /* * Debug tool. Essentially allows for assert(cpuLockTaken); + * + * Returns 1 meaning this thread owns the lock, 0 otherwise. */ static int lkl_check_cpu_owner() diff --git a/arch/lkl/kernel/signal.c b/arch/lkl/kernel/signal.c index 2c946d2ab243e6..5fa8d914772253 100644 --- a/arch/lkl/kernel/signal.c +++ b/arch/lkl/kernel/signal.c @@ -75,6 +75,8 @@ static void handle_signal(struct ksignal *ksig, struct ucontext *uctx) /* * Return only the signal of a given number, while snipping it from the list * Used by the trap handler for sync signals such as SEGV, FPE. + * + * Returns 1 meaning a signal was found, 0 otherwise. */ int get_given_ksignal(struct thread_info *task, struct ksignal* sig, int which) { @@ -209,7 +211,8 @@ void append_ksignal_node(struct thread_info *task, struct ksignal *ksig) task->signal_list_head = node; task->signal_list_tail = node; } else { /* otherwise just the tail changes */ - ptr->next = node; + ptr->next = node; + task->signal_list_tail = node; } spin_unlock(&task->signal_list_lock);