From: Thierry Reding <thierry.reding@gmail.com>
To: Qinglang Miao <miaoqinglang@huawei.com>
Cc: David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Jonathan Hunter <jonathanh@nvidia.com>,
dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/tegra: fix reference leak when pm_runtime_get_sync fails
Date: Fri, 15 Jan 2021 17:26:10 +0100 [thread overview]
Message-ID: <YAHCIsQtRUANr+m+@ulmo> (raw)
In-Reply-To: <20201201125631.142590-1-miaoqinglang@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 916 bytes --]
On Tue, Dec 01, 2020 at 08:56:31PM +0800, Qinglang Miao wrote:
> The PM reference count is not expected to be incremented on
> return in these tegra functions.
>
> However, pm_runtime_get_sync will increment the PM reference
> count even failed. Forgetting to putting operation will result
> in a reference leak here.
>
> Replace it with pm_runtime_resume_and_get to keep usage
> counter balanced.
>
> Fixes: fd67e9c6ed5a ("drm/tegra: Do not implement runtime PM")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
> ---
> drivers/gpu/drm/tegra/dc.c | 2 +-
> drivers/gpu/drm/tegra/dsi.c | 2 +-
> drivers/gpu/drm/tegra/hdmi.c | 2 +-
> drivers/gpu/drm/tegra/hub.c | 2 +-
> drivers/gpu/drm/tegra/sor.c | 2 +-
> drivers/gpu/drm/tegra/vic.c | 2 +-
> 6 files changed, 6 insertions(+), 6 deletions(-)
Applied, thanks.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2021-01-15 16:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-01 12:56 [PATCH] drm/tegra: fix reference leak when pm_runtime_get_sync fails Qinglang Miao
2021-01-15 16:26 ` Thierry Reding [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=YAHCIsQtRUANr+m+@ulmo \
--to=thierry.reding@gmail.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=jonathanh@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=miaoqinglang@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;
as well as URLs for NNTP newsgroup(s).