Commit 0515760f authored by Christophe Jaillet's avatar Christophe Jaillet Committed by Mark Brown

ALSA: ac97c: Fix an error handling path in 'atmel_ac97c_probe()'

If 'clk_prepare_enable()' fails, we must release some resources before
returning. Add a new label in the existing error handling path and 'goto'
there.

Fixes: 260ea95c ("ASoC: atmel: ac97c: Handle return value of clk_prepare_enable.")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent acd617a4
...@@ -785,7 +785,7 @@ static int atmel_ac97c_probe(struct platform_device *pdev) ...@@ -785,7 +785,7 @@ static int atmel_ac97c_probe(struct platform_device *pdev)
} }
retval = clk_prepare_enable(pclk); retval = clk_prepare_enable(pclk);
if (retval) if (retval)
return retval; goto err_prepare_enable;
retval = snd_card_new(&pdev->dev, SNDRV_DEFAULT_IDX1, retval = snd_card_new(&pdev->dev, SNDRV_DEFAULT_IDX1,
SNDRV_DEFAULT_STR1, THIS_MODULE, SNDRV_DEFAULT_STR1, THIS_MODULE,
...@@ -881,6 +881,7 @@ static int atmel_ac97c_probe(struct platform_device *pdev) ...@@ -881,6 +881,7 @@ static int atmel_ac97c_probe(struct platform_device *pdev)
snd_card_free(card); snd_card_free(card);
err_snd_card_new: err_snd_card_new:
clk_disable_unprepare(pclk); clk_disable_unprepare(pclk);
err_prepare_enable:
clk_put(pclk); clk_put(pclk);
return retval; return retval;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment