linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: codecs: Fix an error handling path in va_macro_probe()
@ 2022-04-03  6:10 Christophe JAILLET
  2022-04-03  6:17 ` Christophe JAILLET
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2022-04-03  6:10 UTC (permalink / raw)
  To: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Venkata Prasad Potturu,
	Srinivasa Rao Mandadapu
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, alsa-devel

After a successful lpass_macro_pds_init() call, lpass_macro_pds_exit() must
be called.

Add the missing call in the error handling path of the probe function and
use it.

Fixes: 9e3d83c52844 ("ASoC: codecs: Add power domains support in digital macro codecs")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 sound/soc/codecs/lpass-va-macro.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/lpass-va-macro.c b/sound/soc/codecs/lpass-va-macro.c
index f3cb596058e0..d18b56e60433 100644
--- a/sound/soc/codecs/lpass-va-macro.c
+++ b/sound/soc/codecs/lpass-va-macro.c
@@ -1434,8 +1434,10 @@ static int va_macro_probe(struct platform_device *pdev)
 		va->dmic_clk_div = VA_MACRO_CLK_DIV_2;
 	} else {
 		ret = va_macro_validate_dmic_sample_rate(sample_rate, va);
-		if (!ret)
-			return -EINVAL;
+		if (!ret) {
+			ret = -EINVAL;
+			goto err;
+		}
 	}
 
 	base = devm_platform_ioremap_resource(pdev, 0);
@@ -1492,6 +1494,8 @@ static int va_macro_probe(struct platform_device *pdev)
 err_dcodec:
 	clk_disable_unprepare(va->macro);
 err:
+	lpass_macro_pds_exit(va->pds);
+
 	return ret;
 }
 
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: codecs: Fix an error handling path in va_macro_probe()
  2022-04-03  6:10 [PATCH] ASoC: codecs: Fix an error handling path in va_macro_probe() Christophe JAILLET
@ 2022-04-03  6:17 ` Christophe JAILLET
  0 siblings, 0 replies; 2+ messages in thread
From: Christophe JAILLET @ 2022-04-03  6:17 UTC (permalink / raw)
  To: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Venkata Prasad Potturu,
	Srinivasa Rao Mandadapu
  Cc: linux-kernel, kernel-janitors, alsa-devel

Le 03/04/2022 à 08:10, Christophe JAILLET a écrit :
> After a successful lpass_macro_pds_init() call, lpass_macro_pds_exit() must
> be called.
> 
> Add the missing call in the error handling path of the probe function and
> use it.
> 
> Fixes: 9e3d83c52844 ("ASoC: codecs: Add power domains support in digital macro codecs")

I'll send a V2. The same issue is also in lpass-tx-macro.c and 
lpass-rx-macro.c.

CJ

> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>   sound/soc/codecs/lpass-va-macro.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/codecs/lpass-va-macro.c b/sound/soc/codecs/lpass-va-macro.c
> index f3cb596058e0..d18b56e60433 100644
> --- a/sound/soc/codecs/lpass-va-macro.c
> +++ b/sound/soc/codecs/lpass-va-macro.c
> @@ -1434,8 +1434,10 @@ static int va_macro_probe(struct platform_device *pdev)
>   		va->dmic_clk_div = VA_MACRO_CLK_DIV_2;
>   	} else {
>   		ret = va_macro_validate_dmic_sample_rate(sample_rate, va);
> -		if (!ret)
> -			return -EINVAL;
> +		if (!ret) {
> +			ret = -EINVAL;
> +			goto err;
> +		}
>   	}
>   
>   	base = devm_platform_ioremap_resource(pdev, 0);
> @@ -1492,6 +1494,8 @@ static int va_macro_probe(struct platform_device *pdev)
>   err_dcodec:
>   	clk_disable_unprepare(va->macro);
>   err:
> +	lpass_macro_pds_exit(va->pds);
> +
>   	return ret;
>   }
>   


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-03  6:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-03  6:10 [PATCH] ASoC: codecs: Fix an error handling path in va_macro_probe() Christophe JAILLET
2022-04-03  6:17 ` Christophe JAILLET

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).