From: Alain Volmat <alain.volmat@st.com>
To: Zhang Qilong <zhangqilong3@huawei.com>
Cc: <broonie@kernel.org>, <mcoquelin.stm32@gmail.com>,
<alexandre.torgue@st.com>, <linux-spi@vger.kernel.org>,
<linux-stm32@st-md-mailman.stormreply.com>,
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] spi: stm32: fix reference leak in stm32_spi_resume
Date: Fri, 6 Nov 2020 09:32:47 +0100 [thread overview]
Message-ID: <20201106083247.GA9484@gnbcxd0016.gnb.st.com> (raw)
In-Reply-To: <20201106015217.140476-1-zhangqilong3@huawei.com>
Hi Zhang,
thanks for the patch.
Reviewed-by: Alain Volmat <alain.volmat@st.com>
Alain
On Fri, Nov 06, 2020 at 09:52:17AM +0800, Zhang Qilong wrote:
> pm_runtime_get_sync will increment pm usage counter even it
> failed. Forgetting to pm_runtime_put_noidle will result in
> reference leak in stm32_spi_resume, so we should fix it.
>
> Fixes: db96bf976a4fc ("spi: stm32: fixes suspend/resume management")
> Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
> ---
> drivers/spi/spi-stm32.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
> index 2cc850eb8922..471dedf3d339 100644
> --- a/drivers/spi/spi-stm32.c
> +++ b/drivers/spi/spi-stm32.c
> @@ -2062,6 +2062,7 @@ static int stm32_spi_resume(struct device *dev)
>
> ret = pm_runtime_get_sync(dev);
> if (ret < 0) {
> + pm_runtime_put_noidle(dev);
> dev_err(dev, "Unable to power device:%d\n", ret);
> return ret;
> }
> --
> 2.17.1
>
next prev parent reply other threads:[~2020-11-06 8:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-06 1:52 [PATCH] spi: stm32: fix reference leak in stm32_spi_resume Zhang Qilong
2020-11-06 8:32 ` Alain Volmat [this message]
2020-11-06 11:54 ` Mark Brown
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=20201106083247.GA9484@gnbcxd0016.gnb.st.com \
--to=alain.volmat@st.com \
--cc=alexandre.torgue@st.com \
--cc=broonie@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-spi@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=zhangqilong3@huawei.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox