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 --]
WARNING: multiple messages have this Message-ID (diff)
From: Pavel Machek <pavel@ucw.cz>
To: cgel.zte@gmail.com
Cc: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com,
nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org,
alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org,
Minghao Chi <chi.minghao@zte.com.cn>,
Zeal Robot <zealci@zte.com.cn>
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 --]
next prev parent reply other threads:[~2022-04-20 7:49 UTC|newest]
Thread overview: 8+ 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 8:30 ` cgel.zte
2022-04-12 12:47 ` Shengjiu Wang
2022-04-12 12:47 ` Shengjiu Wang
2022-04-12 19:50 ` Mark Brown
2022-04-12 19:50 ` Mark Brown
2022-04-20 7:48 ` Pavel Machek [this message]
2022-04-20 7:48 ` Pavel Machek
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.cz \
--cc=Xiubo.Lee@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=cgel.zte@gmail.com \
--cc=chi.minghao@zte.com.cn \
--cc=festevam@gmail.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=nicoleotsuka@gmail.com \
--cc=shengjiu.wang@gmail.com \
--cc=zealci@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.