From: Li Zhong <floridsleeves@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: tglx@linutronix.de, Li Zhong <floridsleeves@gmail.com>
Subject: [PATCH v1] kernel/irq/manage: check return value of irq_data_get_irq_chip()
Date: Fri, 16 Sep 2022 18:53:48 -0700 [thread overview]
Message-ID: <20220917015348.3831203-1-floridsleeves@gmail.com> (raw)
Check the return value chip of irq_data_get_irq_chip(), which could be
NULL and result in null pointer dereference if unchecked.
Signed-off-by: Li Zhong <floridsleeves@gmail.com>
---
kernel/irq/manage.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 40fe7806cc8c..1f967050338b 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -202,6 +202,8 @@ static void irq_validate_effective_affinity(struct irq_data *data)
if (!cpumask_empty(m))
return;
+ if (!chip)
+ return;
pr_warn_once("irq_chip %s did not update eff. affinity mask of irq %u\n",
chip->name, data->irq);
}
--
2.25.1
reply other threads:[~2022-09-17 1:54 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=20220917015348.3831203-1-floridsleeves@gmail.com \
--to=floridsleeves@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/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®