[tip: locking/core] signal: Fix the lock_task_sighand() annotation

From: tip-bot2 for Bart Van Assche

Date: Sat Feb 28 2026 - 05:56:50 EST


The following commit has been merged into the locking/core branch of tip:

Commit-ID: 39be7b21af24d1d2ed3b18caac57dd219fef226e
Gitweb: https://git.kernel.org/tip/39be7b21af24d1d2ed3b18caac57dd219fef226e
Author: Bart Van Assche <bvanassche@xxxxxxx>
AuthorDate: Wed, 25 Feb 2026 10:32:42 -08:00
Committer: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
CommitterDate: Fri, 27 Feb 2026 16:40:19 +01:00

signal: Fix the lock_task_sighand() annotation

lock_task_sighand() may return NULL. Make this clear in its lock context
annotation.

Fixes: 04e49d926f43 ("sched: Enable context analysis for core.c and fair.c")
Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Acked-by: Marco Elver <elver@xxxxxxxxxx>
Link: https://patch.msgid.link/20260225183244.4035378-3-bvanassche@xxxxxxx
---
include/linux/sched/signal.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h
index a22248a..a4835a7 100644
--- a/include/linux/sched/signal.h
+++ b/include/linux/sched/signal.h
@@ -739,7 +739,7 @@ static inline int thread_group_empty(struct task_struct *p)

extern struct sighand_struct *lock_task_sighand(struct task_struct *task,
unsigned long *flags)
- __acquires(&task->sighand->siglock);
+ __cond_acquires(nonnull, &task->sighand->siglock);

static inline void unlock_task_sighand(struct task_struct *task,
unsigned long *flags)