diff options
| author | Thomas Gleixner <[email protected]> | 2015-12-31 16:30:45 +0000 |
|---|---|---|
| committer | Thomas Gleixner <[email protected]> | 2016-01-15 13:43:59 +0100 |
| commit | 36f34c8c63da3e272fd66f91089228c22d2b6e8b (patch) | |
| tree | 7797528912186ea732fb2679482472f1a90f2b35 | |
| parent | 111abeba67e0dbdc26537429de9155e4f1d807d8 (diff) | |
x86/irq: Validate that irq descriptor is still active
In fixup_irqs() we unconditionally dereference the irq chip of an irq
descriptor. The descriptor might still be valid, but already cleaned up,
i.e. the chip removed. Add a check for this condition.
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: Jiang Liu <[email protected]>
Cc: Joe Lawrence <[email protected]>
Cc: Jeremiah Mahler <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: [email protected]
Cc: Guenter Roeck <[email protected]>
Cc: [email protected] #4.3+
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
| -rw-r--r-- | arch/x86/kernel/irq.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index f8062aaf5df9..c0b58dd1ca04 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c @@ -470,6 +470,15 @@ void fixup_irqs(void) } chip = irq_data_get_irq_chip(data); + /* + * The interrupt descriptor might have been cleaned up + * already, but it is not yet removed from the radix tree + */ + if (!chip) { + raw_spin_unlock(&desc->lock); + continue; + } + if (!irqd_can_move_in_process_context(data) && chip->irq_mask) chip->irq_mask(data); |