Skip to content

Commit

Permalink
kernel/irq/irqdomain.c: before use 'irq_data', need check it whether …
Browse files Browse the repository at this point in the history
…valid.

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 <[email protected]>
Signed-off-by: Grant Likely <[email protected]>
  • Loading branch information
Chen Gang authored and glikely committed Jun 8, 2013
1 parent 346dbb7 commit 275e31b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/irq/irqdomain.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 275e31b

Please sign in to comment.