OSDN Git Service

ASoC: ti: omap-mcbsp: Fix an error handling path in 'asoc_mcbsp_probe()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 12 May 2020 13:43:25 +0000 (15:43 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 12 May 2020 16:14:36 +0000 (17:14 +0100)
commit03990fd58d2b7c8f7d53e514ba9b8749fac260f9
tree157fd7c49d9d9cd6a74179dec12b4f8d024e6951
parentcc2d025a81a9f9ed4d05f4f65f43a183d6f18c0c
ASoC: ti: omap-mcbsp: Fix an error handling path in 'asoc_mcbsp_probe()'

If an error occurs after the call to 'omap_mcbsp_init()', the reference to
'mcbsp->fclk' must be decremented, as already done in the remove function.

This can be achieved easily by using the devm_ variant of 'clk_get()'
when the reference is taken in 'omap_mcbsp_init()'

This fixes the leak in the probe and has the side effect to simplify both
the error handling path of 'omap_mcbsp_init()' and the remove function.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Peter Ujfalusi <peter.ujflausi@ti.com>
Link: https://lore.kernel.org/r/20200512134325.252073-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/ti/omap-mcbsp.c