public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw•cz>
To: cgel.zte@gmail•com
Cc: alsa-devel@alsa-project•org, Xiubo.Lee@gmail•com,
	shengjiu.wang@gmail•com, Zeal Robot <zealci@zte•com.cn>,
	linuxppc-dev@lists•ozlabs.org, lgirdwood@gmail•com,
	Minghao Chi <chi.minghao@zte•com.cn>,
	linux-kernel@vger•kernel.org, nicoleotsuka@gmail•com,
	broonie@kernel•org, festevam@gmail•com
Subject: Re: [PATCH] ASoC: fsl: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
Date: Wed, 20 Apr 2022 09:48:55 +0200	[thread overview]
Message-ID: <20220420074855.GA25823@amd> (raw)
In-Reply-To: <20220412083000.2532711-1-chi.minghao@zte.com.cn>

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

Hi!

> From: Minghao Chi <chi.minghao@zte•com.cn>
> 
> Using pm_runtime_resume_and_get is more appropriate
> for simplifing code
> 
> Reported-by: Zeal Robot <zealci@zte•com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte•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.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

      parent reply	other threads:[~2022-04-20  7:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12  8:30 [PATCH] ASoC: fsl: using pm_runtime_resume_and_get instead of pm_runtime_get_sync cgel.zte
2022-04-12 12:47 ` Shengjiu Wang
2022-04-12 19:50 ` Mark Brown
2022-04-20  7:48 ` Pavel Machek [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220420074855.GA25823@amd \
    --to=pavel@ucw$(echo .)cz \
    --cc=Xiubo.Lee@gmail$(echo .)com \
    --cc=alsa-devel@alsa-project$(echo .)org \
    --cc=broonie@kernel$(echo .)org \
    --cc=cgel.zte@gmail$(echo .)com \
    --cc=chi.minghao@zte$(echo .)com.cn \
    --cc=festevam@gmail$(echo .)com \
    --cc=lgirdwood@gmail$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=nicoleotsuka@gmail$(echo .)com \
    --cc=shengjiu.wang@gmail$(echo .)com \
    --cc=zealci@zte$(echo .)com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox