[PATCH 3/6] ASoC: wm8903: Free the IRQ when component registration fails

Arina Kharlamova via B4 Relay devnull+arina.kharlamova.mbzuai.ac.ae at kernel.org
Tue Dec 1 11:23:34 PST 2026


From: Arina Kharlamova <arina.kharlamova at mbzuai.ac.ae>

wm8903_i2c_probe() requests the interrupt with wm8903 as dev_id before
it registers the component. If devm_snd_soc_register_component()
fails, the error path only disables the regulators. The interrupt
stays requested while wm8903, which is devm allocated, is freed.

Free the interrupt on that error path.

Fixes: b7c95d9146c8 ("ASoC: wm8903: Move interrupt request to I2C probe")
Signed-off-by: Arina Kharlamova <arina.kharlamova at mbzuai.ac.ae>
---
 sound/soc/codecs/wm8903.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index d47799209727..9f988e217bbf 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -2195,9 +2195,12 @@ static int wm8903_i2c_probe(struct i2c_client *i2c)
 	ret = devm_snd_soc_register_component(&i2c->dev,
 			&soc_component_dev_wm8903, &wm8903_dai, 1);
 	if (ret != 0)
-		goto err;
+		goto err_irq;
 
 	return 0;
+err_irq:
+	if (i2c->irq)
+		free_irq(i2c->irq, wm8903);
 err:
 	regulator_bulk_disable(ARRAY_SIZE(wm8903->supplies),
 			       wm8903->supplies);

-- 
Git-157)





More information about the Linux-rockchip mailing list