[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220420074855.GA25823@amd>
Date: Wed, 20 Apr 2022 09:48:55 +0200
From: Pavel Machek <pavel@....cz>
To: cgel.zte@...il.com
Cc: shengjiu.wang@...il.com, Xiubo.Lee@...il.com, festevam@...il.com,
nicoleotsuka@...il.com, lgirdwood@...il.com, broonie@...nel.org,
alsa-devel@...a-project.org, linuxppc-dev@...ts.ozlabs.org,
linux-kernel@...r.kernel.org, Minghao Chi <chi.minghao@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH] ASoC: fsl: using pm_runtime_resume_and_get instead of
pm_runtime_get_sync
Hi!
> From: Minghao Chi <chi.minghao@....com.cn>
>
> Using pm_runtime_resume_and_get is more appropriate
> for simplifing code
>
> Reported-by: Zeal Robot <zealci@....com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@....com.cn>
> ---
> sound/soc/fsl/fsl_esai.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
> index ed444e8f1d6b..1a2bdf8e76f0 100644
> --- a/sound/soc/fsl/fsl_esai.c
> +++ b/sound/soc/fsl/fsl_esai.c
> @@ -1050,11 +1050,9 @@ static int fsl_esai_probe(struct platform_device *pdev)
> goto err_pm_disable;
> }
>
> - ret = pm_runtime_get_sync(&pdev->dev);
> - if (ret < 0) {
> - pm_runtime_put_noidle(&pdev->dev);
> + ret = pm_runtime_resume_and_get(&pdev->dev);
> + if (ret < 0)
> goto err_pm_get_sync;
> - }
>
> ret = fsl_esai_hw_init(esai_priv);
> if (ret)
Please take a closer look at that function.
a) error labels are now misnamed
b) there's leak if
ret = fsl_esai_hw_init(esai_priv);
if (ret)
goto err_pm_get_sync;
happens.
Best regards,
Pavel
--
People of Russia, stop Putin before his war on Ukraine escalates.
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists