Thread (2 messages) flat view 2 messages, 2 authors, 15h ago
HOTtoday

[PATCH] ALSA: aoa: i2sbus: Check IRQ before requesting it

From: <hidden>
Date: 2026-08-24 10:07:43
Also in: linux-sound, lkml
Subsystem: aoa (apple onboard audio) alsa driver, sound, the rest · Maintainers: Johannes Berg, Jaroslav Kysela, Takashi Iwai, Linus Torvalds

From: bui duc phuc <redacted>

irq_of_parse_and_map() returns 0 when parsing or mapping an IRQ fails.
The return value was passed to request_irq() without checking for
failure.

Check the return value before passing it to request_irq().

Signed-off-by: bui duc phuc <redacted>
---
 sound/aoa/soundbus/i2sbus/core.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c
index 833c44c0a950..adf123dd79a2 100644
--- a/sound/aoa/soundbus/i2sbus/core.c
+++ b/sound/aoa/soundbus/i2sbus/core.c
@@ -240,6 +240,8 @@ static int i2sbus_add_dev(struct macio_dev *macio,
 	}
 	for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++) {
 		int irq = irq_of_parse_and_map(np, i);
+		if (!irq)
+			goto err;
 		if (request_irq(irq, ints[i], 0, dev->rnames[i], dev))
 			goto err;
 		dev->interrupts[i] = irq;
-- 
2.43.0

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help