summaryrefslogtreecommitdiffstats
path: root/kernel/irq/chip.c
diff options
context:
space:
mode:
authorWang Chen <wangchen@cn.fujitsu.com>2008-12-29 06:35:11 +0100
committerIngo Molnar <mingo@elte.hu>2008-12-29 12:22:29 +0100
commitefdc64f0c792ea744bcc9203f35b908e66d42f41 (patch)
tree014d9895f776d98bf933855e5af2da99d5b34824 /kernel/irq/chip.c
parentMerge branches 'irq/sparseirq', 'irq/genirq' and 'irq/urgent'; commit 'v2.6.2... (diff)
downloadlinux-efdc64f0c792ea744bcc9203f35b908e66d42f41.tar.xz
linux-efdc64f0c792ea744bcc9203f35b908e66d42f41.zip
genirq: check chip->ack before calling
Impact: fix theoretical NULL dereference The generic irq layer doesn't know whether irq_chip has ack routine on some architectures or not. Upon that, before calling chip->ack, we should check that it's not NULL. Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/irq/chip.c')
-rw-r--r--kernel/irq/chip.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 6eb3c7952b64..0ad02d76a0c4 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -290,7 +290,8 @@ static inline void mask_ack_irq(struct irq_desc *desc, int irq)
desc->chip->mask_ack(irq);
else {
desc->chip->mask(irq);
- desc->chip->ack(irq);
+ if (desc->chip->ack)
+ desc->chip->ack(irq);
}
}
@@ -475,7 +476,8 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc)
kstat_incr_irqs_this_cpu(irq, desc);
/* Start handling the irq */
- desc->chip->ack(irq);
+ if (desc->chip->ack)
+ desc->chip->ack(irq);
desc = irq_remap_to_desc(irq, desc);
/* Mark the IRQ currently in progress.*/