From: Ye Bin <yebin10@huawei.com>
To: <tglx@linutronix.de>, <jason@lakedaemon.net>, <maz@kernel.org>,
<linux-kernel@vger.kernel.org>
Cc: Ye Bin <yebin10@huawei.com>
Subject: [PATCH] irqchip/tango: Fix possible null ptr reference in tangox_irq_init
Date: Thu, 3 Sep 2020 09:59:52 +0800 [thread overview]
Message-ID: <20200903015952.308888-1-yebin10@huawei.com> (raw)
In tangox_irq_init allocate chip but not test.
Signed-off-by: Ye Bin <yebin10@huawei.com>
---
drivers/irqchip/irq-tango.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/irqchip/irq-tango.c b/drivers/irqchip/irq-tango.c
index 34290f09b853..25da120230ad 100644
--- a/drivers/irqchip/irq-tango.c
+++ b/drivers/irqchip/irq-tango.c
@@ -187,6 +187,8 @@ static int __init tangox_irq_init(void __iomem *base, struct resource *baseres,
panic("%pOFn: failed to get address", node);
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
+ if (!chip)
+ panic("%pOFn: failed to get chip", node);
chip->ctl = res.start - baseres->start;
chip->base = base;
--
2.25.4
next reply other threads:[~2020-09-03 2:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-03 1:59 Ye Bin [this message]
2020-09-03 8:10 ` [PATCH] irqchip/tango: Fix possible null ptr reference in tangox_irq_init Marc Zyngier
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=20200903015952.308888-1-yebin10@huawei.com \
--to=yebin10@huawei.com \
--cc=jason@lakedaemon.net \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@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