Skip to content

Commit

Permalink
ALSA: ac97c: Fix an error handling path in 'atmel_ac97c_probe()'
Browse files Browse the repository at this point in the history
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: 260ea95 ("ASoC: atmel: ac97c: Handle return value of clk_prepare_enable.")
Signed-off-by: Christophe JAILLET <[email protected]>
Acked-by: Alexandre Belloni <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
tititiou36 authored and broonie committed Aug 31, 2017
1 parent acd617a commit 0515760
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sound/atmel/ac97c.c
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ static int atmel_ac97c_probe(struct platform_device *pdev)
}
retval = clk_prepare_enable(pclk);
if (retval)
return retval;
goto err_prepare_enable;

retval = snd_card_new(&pdev->dev, SNDRV_DEFAULT_IDX1,
SNDRV_DEFAULT_STR1, THIS_MODULE,
Expand Down Expand Up @@ -881,6 +881,7 @@ static int atmel_ac97c_probe(struct platform_device *pdev)
snd_card_free(card);
err_snd_card_new:
clk_disable_unprepare(pclk);
err_prepare_enable:
clk_put(pclk);
return retval;
}
Expand Down

0 comments on commit 0515760

Please sign in to comment.