kernel/irq/irqdomain.c: before use 'irq_data', need check it whether valid.
authorChen Gang <gang.chen@asianux.com>
Tue, 14 May 2013 11:02:45 +0000 (19:02 +0800)
committerGrant Likely <grant.likely@linaro.org>
Sat, 8 Jun 2013 20:15:09 +0000 (21:15 +0100)
Since irq_data may be NULL, if so, we WARN_ON(), and continue, 'hwirq'
which related with 'irq_data' has to initialize later, or it will cause
issue.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
kernel/irq/irqdomain.c

index d1adaedb435f7d0dcc1589fdedba3c390efb34dc..8c4c8ea6a205c7c67a1d110abf683a01731e46ba 100644 (file)
@@ -398,11 +398,12 @@ static void irq_domain_disassociate_many(struct irq_domain *domain,
        while (count--) {
                int irq = irq_base + count;
                struct irq_data *irq_data = irq_get_irq_data(irq);
-               irq_hw_number_t hwirq = irq_data->hwirq;
+               irq_hw_number_t hwirq;
 
                if (WARN_ON(!irq_data || irq_data->domain != domain))
                        continue;
 
+               hwirq = irq_data->hwirq;
                irq_set_status_flags(irq, IRQ_NOREQUEST);
 
                /* remove chip and handler */