]> git.baikalelectronics.ru Git - kernel.git/commit
x86/ioapic: Prevent NULL pointer dereference in setup_ioapic_dest()
authorWerner Pawlitschko <werner.pawlitschko@arcor.de>
Tue, 27 Oct 2015 00:08:04 +0000 (09:08 +0900)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 27 Oct 2015 00:18:34 +0000 (09:18 +0900)
commita08f541275ed135ba160814172b2129fc533b7e1
tree48ae676a2075db84e5c0357220d9badc33993cee
parent977cd231a5f1cec6ef6316be32fabf6cb7c78b07
x86/ioapic: Prevent NULL pointer dereference in setup_ioapic_dest()

Commit 8417b52f780c changed the way how irq affinity is setup in
setup_ioapic_dest() from using the core helper function to
unconditionally calling the irq_set_affinity() callback of the
underlying irq chip.

That results in a NULL pointer dereference for the rare case where the
underlying irq chip is lapic_chip which has no irq_set_affinity()
callback. lapic_chip is occasionally used for the timer interrupt (irq
0).

The fix is simple: Check the availability of the callback instead of
calling it unconditionally.

Fixes: 8417b52f780c "x86/ioapic: Force affinity setting in setup_ioapic_dest()"
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
arch/x86/kernel/apic/io_apic.c