Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit efdc64f0 authored by Wang Chen's avatar Wang Chen Committed by Ingo Molnar
Browse files

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: default avatarWang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 860cf889
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -290,6 +290,7 @@ static inline void mask_ack_irq(struct irq_desc *desc, int irq)
		desc->chip->mask_ack(irq);
	else {
		desc->chip->mask(irq);
		if (desc->chip->ack)
			desc->chip->ack(irq);
	}
}
@@ -475,6 +476,7 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc)
	kstat_incr_irqs_this_cpu(irq, desc);

	/* Start handling the irq */
	if (desc->chip->ack)
		desc->chip->ack(irq);
	desc = irq_remap_to_desc(irq, desc);