Skip to content

Commit ed92bc5

Browse files
tititiou36broonie
authored andcommitted
ASoC: codecs: wm0010: Fix error handling path in wm0010_spi_probe()
Free some resources in the error handling path of the probe, as already done in the remove function. Fixes: e3523e0 ("ASoC: wm0010: Add initial wm0010 DSP driver") Fixes: fd8b965 ("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>
1 parent 247fba1 commit ed92bc5

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

sound/soc/codecs/wm0010.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ static int wm0010_spi_probe(struct spi_device *spi)
920920
if (ret) {
921921
dev_err(wm0010->dev, "Failed to set IRQ %d as wake source: %d\n",
922922
irq, ret);
923-
return ret;
923+
goto free_irq;
924924
}
925925

926926
if (spi->max_speed_hz)
@@ -932,9 +932,18 @@ static int wm0010_spi_probe(struct spi_device *spi)
932932
&soc_component_dev_wm0010, wm0010_dai,
933933
ARRAY_SIZE(wm0010_dai));
934934
if (ret < 0)
935-
return ret;
935+
goto disable_irq_wake;
936936

937937
return 0;
938+
939+
disable_irq_wake:
940+
irq_set_irq_wake(wm0010->irq, 0);
941+
942+
free_irq:
943+
if (wm0010->irq)
944+
free_irq(wm0010->irq, wm0010);
945+
946+
return ret;
938947
}
939948

940949
static void wm0010_spi_remove(struct spi_device *spi)

0 commit comments

Comments
 (0)