Revert "signal: Replace BUG_ON()s"

This reverts commit dd7f63056a.
This commit is contained in:
Ksawlii 2024-11-24 00:23:07 +01:00
parent 12406b34ef
commit 62994ec6e3

View file

@ -1847,11 +1847,10 @@ struct sigqueue *sigqueue_alloc(void)
void sigqueue_free(struct sigqueue *q)
{
spinlock_t *lock = &current->sighand->siglock;
unsigned long flags;
spinlock_t *lock = &current->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;