From 4bde7db5bab658fb530b7ac67d74ce0cd34fe8c7 Mon Sep 17 00:00:00 2001 From: Hyunki Koo Date: Thu, 11 Oct 2018 19:27:21 +0900 Subject: [PATCH] [ERD][NEUS7920-76] [COMMON] lib: dss: add null check before refer to desc->action Change-Id: I9f5211c8a08b94ce5430cb49995e5be79d3ab567 Signed-off-by: Hyunki Koo --- kernel/irq/irqdesc.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index fbdea4868f43..2d13dd5899f7 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -602,20 +602,25 @@ void irq_init_desc(unsigned int irq) int generic_handle_irq(unsigned int irq) { struct irq_desc *desc = irq_to_desc(irq); - struct irqaction *action; + irq_handler_t handler; unsigned long long start_time; if (!desc) return -EINVAL; - action = desc->action; dbg_snapshot_irq_var(start_time); - dbg_snapshot_irq(irq, (void *)action->handler, (void *)desc, + + if (likely(desc->action)) + handler = desc->action->handler; + else + handler = NULL; + + dbg_snapshot_irq(irq, (void *)handler, (void *)desc, 0, DSS_FLAG_IN); generic_handle_irq_desc(desc); - dbg_snapshot_irq(irq, (void *)action->handler, (void *)desc, + dbg_snapshot_irq(irq, (void *)handler, (void *)desc, start_time, DSS_FLAG_OUT); return 0; -- 2.20.1