From 0976004f3c7a6e1820c71c2540db667f577238ee Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Mon, 26 May 2008 20:55:42 +0400 Subject: [PATCH] --- yaml --- r: 97392 b: refs/heads/master c: c8e85b4f4b9ee23bf0e79bdeb3da274a0f9c663f h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/kernel/signal.c | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 1fd3af9b6b03..a1a0e804db1e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 84a881657d391121cd88c37f0a312dec3528fa44 +refs/heads/master: c8e85b4f4b9ee23bf0e79bdeb3da274a0f9c663f diff --git a/trunk/kernel/signal.c b/trunk/kernel/signal.c index 12ffea7c201d..2955f6c4f36e 100644 --- a/trunk/kernel/signal.c +++ b/trunk/kernel/signal.c @@ -1240,18 +1240,22 @@ void sigqueue_free(struct sigqueue *q) BUG_ON(!(q->flags & SIGQUEUE_PREALLOC)); /* - * If the signal is still pending remove it from the - * pending queue. We must hold ->siglock while testing - * q->list to serialize with collect_signal() or with + * We must hold ->siglock while testing q->list + * to serialize with collect_signal() or with * __exit_signal()->flush_sigqueue(). */ spin_lock_irqsave(lock, flags); + q->flags &= ~SIGQUEUE_PREALLOC; + /* + * If it is queued it will be freed when dequeued, + * like the "regular" sigqueue. + */ if (!list_empty(&q->list)) - list_del_init(&q->list); + q = NULL; spin_unlock_irqrestore(lock, flags); - q->flags &= ~SIGQUEUE_PREALLOC; - __sigqueue_free(q); + if (q) + __sigqueue_free(q); } int send_sigqueue(struct sigqueue *q, struct task_struct *t, int group)