lkml.org 
[lkml]   [2020]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] irqchip/tango: Fix possible null ptr reference in tangox_irq_init
Date
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
\
 
 \ /
  Last update: 2020-09-03 04:01    [W:0.141 / U:0.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site