From: trix@redhat.com
To: ebiederm@xmission.com, christian.brauner@ubuntu.com,
arnd@arndb.de, akpm@linux-foundation.org, guro@fb.com,
deepa.kernel@gmail.com, linux-kernel@vger.kernel.org
Cc: Tom Rix <trix@redhat.com>
Subject: [PATCH] signal: move print_dropped_signal
Date: Tue, 3 Dec 2019 10:02:21 -0800 [thread overview]
Message-ID: <20191203180221.7038-1-trix@redhat.com> (raw)
From: Tom Rix <trix@redhat.com>
If the allocation of 'q' fails, the signal will be dropped.
To ensure that this is reported, move print_dropped_signal to be
inside the '(q == NULL)' if-check.
Signed-off-by: Tom Rix <trix@redhat.com>
---
kernel/signal.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kernel/signal.c b/kernel/signal.c
index bcd46f547db3..294a4625200e 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -427,11 +427,10 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimi
atomic_read(&user->sigpending) <=
task_rlimit(t, RLIMIT_SIGPENDING)) {
q = kmem_cache_alloc(sigqueue_cachep, flags);
- } else {
- print_dropped_signal(sig);
}
if (unlikely(q == NULL)) {
+ print_dropped_signal(sig);
atomic_dec(&user->sigpending);
free_uid(user);
} else {
--
2.18.1
reply other threads:[~2019-12-03 18:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191203180221.7038-1-trix@redhat.com \
--to=trix@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=christian.brauner@ubuntu.com \
--cc=deepa.kernel@gmail.com \
--cc=ebiederm@xmission.com \
--cc=guro@fb.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®