[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190129080122.20392-1-yuehaibing@huawei.com>
Date: Tue, 29 Jan 2019 16:01:22 +0800
From: YueHaibing <yuehaibing@...wei.com>
To: <tglx@...utronix.de>, <jason@...edaemon.net>,
<marc.zyngier@....com>, <marc.w.gonzalez@...e.fr>, <mans@...sr.com>
CC: <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
YueHaibing <yuehaibing@...wei.com>
Subject: [PATCH -next] irqchip/tango: Fix potential NULL pointer dereference
There is a potential NULL pointer dereference in case kzalloc()
fails and returns NULL.
Fixes: 4bba66899ac6 ("irqchip/tango: Add support for Sigma Designs SMP86xx/SMP87xx interrupt controller")
Signed-off-by: YueHaibing <yuehaibing@...wei.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 ae28d86..a63b828 100644
--- a/drivers/irqchip/irq-tango.c
+++ b/drivers/irqchip/irq-tango.c
@@ -191,6 +191,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)
+ return -ENOMEM;
chip->ctl = res.start - baseres->start;
chip->base = base;
--
2.7.0
Powered by blists - more mailing lists