diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2012-05-03 12:22:06 +0200 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2012-05-31 00:43:59 +0100 |
commit | be8ad46e10b99411acae4f0461be547f32a08686 (patch) | |
tree | 5f77f28f1c6f4712d81ae2d9b9a0548c6e303009 /drivers/gpio | |
parent | 5bd4e74937adf1f00f29e5983fe1b364accb74ea (diff) |
gpio: mpc8xxx: Prevent NULL pointer deref in demux handler
commit d6de85e85edcc38c9edcde45a0a568818fcddc13 upstream.
commit cfadd838(powerpc/8xxx: Fix interrupt handling in MPC8xxx GPIO
driver) added an unconditional call of chip->irq_eoi() to the demux
handler.
This leads to a NULL pointer derefernce on MPC512x platforms which use
this driver as well.
Make it conditional.
Reported-by: Thomas Wucher <thwucher@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Felix Radensky <felix@embedded-sol.com>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-mpc8xxx.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c index 5cd04b65c556..edcffd6bf88c 100644 --- a/drivers/gpio/gpio-mpc8xxx.c +++ b/drivers/gpio/gpio-mpc8xxx.c @@ -163,7 +163,8 @@ static void mpc8xxx_gpio_irq_cascade(unsigned int irq, struct irq_desc *desc) if (mask) generic_handle_irq(irq_linear_revmap(mpc8xxx_gc->irq, 32 - ffs(mask))); - chip->irq_eoi(&desc->irq_data); + if (chip->irq_eoi) + chip->irq_eoi(&desc->irq_data); } static void mpc8xxx_irq_unmask(struct irq_data *d) |