From 62994ec6e32bf0f41fbd182f2395c404cdeab71c Mon Sep 17 00:00:00 2001 From: Ksawlii Date: Sun, 24 Nov 2024 00:23:07 +0100 Subject: [PATCH] Revert "signal: Replace BUG_ON()s" This reverts commit dd7f63056a0221dfd13705edc4715a308e438652. --- kernel/signal.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/kernel/signal.c b/kernel/signal.c index 4754985a8..f81f7f19d 100755 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -1847,11 +1847,10 @@ struct sigqueue *sigqueue_alloc(void) void sigqueue_free(struct sigqueue *q) { - spinlock_t *lock = ¤t->sighand->siglock; unsigned long flags; + spinlock_t *lock = ¤t->sighand->siglock; - if (WARN_ON_ONCE(!(q->flags & SIGQUEUE_PREALLOC))) - return; + BUG_ON(!(q->flags & SIGQUEUE_PREALLOC)); /* * We must hold ->siglock while testing q->list * to serialize with collect_signal() or with @@ -1879,10 +1878,7 @@ int send_sigqueue(struct sigqueue *q, struct pid *pid, enum pid_type type) unsigned long flags; int ret, result; - if (WARN_ON_ONCE(!(q->flags & SIGQUEUE_PREALLOC))) - return 0; - if (WARN_ON_ONCE(q->info.si_code != SI_TIMER)) - return 0; + BUG_ON(!(q->flags & SIGQUEUE_PREALLOC)); ret = -1; rcu_read_lock(); @@ -1901,6 +1897,7 @@ int send_sigqueue(struct sigqueue *q, struct pid *pid, enum pid_type type) * If an SI_TIMER entry is already queue just increment * the overrun count. */ + BUG_ON(q->info.si_code != SI_TIMER); q->info.si_overrun++; result = TRACE_SIGNAL_ALREADY_PENDING; goto out;