linux/kernel/irq
Jesper Juhl 13863a66c9 genirq: Prevent potential NULL dereference in irq_set_irq_wake()
In kernel/irq/manage.c::irq_set_irq_wake() we call
irq_get_desc_buslock() which may return NULL, but the code
dereferences the result unconditionally.

irq_set_irq_wake() has lots of callers - I checked a few and I couldn't
find anything that guarantees that they won't call it with some input that
will cause irq_get_desc_buslock() to return NULL, so I think it's a good
thing to test and -EINVAL was the most sane error code in this situation
that I could think of.

Not all callers test the return value of irq_set_irq_wake(), but those
that do take != 0 to mean error as far as I can see, so they should be
fine. I guess those that don't test actually should, but that's a
different issue.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Link: http://lkml.kernel.org/r/alpine.LNX.2.00.1106092300360.17868@swampdragon.chaosbits.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-06-10 10:53:42 +02:00
..
Kconfig
Makefile
autoprobe.c
chip.c
debug.h
devres.c
dummychip.c
generic-chip.c
handle.c irq: Handle spurios irq detection for threaded irqs 2011-06-03 14:53:15 +02:00
internals.h
irqdesc.c genirq: Ensure we locate the passed IRQ in irq_alloc_descs() 2011-06-03 14:53:16 +02:00
manage.c genirq: Prevent potential NULL dereference in irq_set_irq_wake() 2011-06-10 10:53:42 +02:00
migration.c
pm.c
proc.c
resend.c
settings.h
spurious.c irq: Handle spurios irq detection for threaded irqs 2011-06-03 14:53:15 +02:00