diff options
| author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2025-03-10 18:45:36 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-04-10 14:29:37 +0200 |
| commit | f26d827172c31c3b93c2034fcbc1be5edd013e25 (patch) | |
| tree | 1c4e4f18379b1a7c98fddc831e3eb7754076101d /sound | |
| parent | 5d45755de5ae624cf2f88345441601b0743a1d66 (diff) | |
| download | linux-f26d827172c31c3b93c2034fcbc1be5edd013e25.tar.gz linux-f26d827172c31c3b93c2034fcbc1be5edd013e25.tar.bz2 linux-f26d827172c31c3b93c2034fcbc1be5edd013e25.zip | |
ASoC: codecs: wm0010: Fix error handling path in wm0010_spi_probe()
[ Upstream commit ed92bc5264c4357d4fca292c769ea9967cd3d3b6 ]
Free some resources in the error handling path of the probe, as already
done in the remove function.
Fixes: e3523e01869d ("ASoC: wm0010: Add initial wm0010 DSP driver")
Fixes: fd8b96574456 ("ASoC: wm0010: Clear IRQ as wake source and include missing header")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/5139ba1ab8c4c157ce04e56096a0f54a1683195c.1741549792.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound')
| -rw-r--r-- | sound/soc/codecs/wm0010.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sound/soc/codecs/wm0010.c b/sound/soc/codecs/wm0010.c index 727d6703c905..ff4bd7d5c59e 100644 --- a/sound/soc/codecs/wm0010.c +++ b/sound/soc/codecs/wm0010.c @@ -955,7 +955,7 @@ static int wm0010_spi_probe(struct spi_device *spi) if (ret) { dev_err(wm0010->dev, "Failed to set IRQ %d as wake source: %d\n", irq, ret); - return ret; + goto free_irq; } if (spi->max_speed_hz) @@ -967,9 +967,18 @@ static int wm0010_spi_probe(struct spi_device *spi) &soc_component_dev_wm0010, wm0010_dai, ARRAY_SIZE(wm0010_dai)); if (ret < 0) - return ret; + goto disable_irq_wake; return 0; + +disable_irq_wake: + irq_set_irq_wake(wm0010->irq, 0); + +free_irq: + if (wm0010->irq) + free_irq(wm0010->irq, wm0010); + + return ret; } static int wm0010_spi_remove(struct spi_device *spi) |
