From: Johan Hovold <johan@kernel.org>
To: Guangshuo Li <lgs201920130244@gmail.com>
Cc: "Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"Hans Verkuil" <hverkuil+cisco@kernel.org>,
"Nicolas Dufresne" <nicolas.dufresne@collabora.com>,
"Marco Crivellari" <marco.crivellari@suse.com>,
"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
"Kees Cook" <kees@kernel.org>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] media: platform: mtk-mdp3: Fix SCP device refcounting
Date: Mon, 6 Jul 2026 08:50:17 +0200 [thread overview]
Message-ID: <aktQKf4QrsnUADdf@hovoldconsulting.com> (raw)
In-Reply-To: <20260704173119.254975-1-lgs201920130244@gmail.com>
On Sun, Jul 05, 2026 at 01:31:19AM +0800, Guangshuo Li wrote:
> mdp_probe() first tries to get the SCP handle with scp_get(). When that
> fails, it falls back to looking up the SCP platform device with
> __get_pdev_by_id() and then reads its driver data.
>
> The fallback lookup returns the platform device with a reference, just
> like scp_get() does. However, the fallback path currently drops that
> reference immediately after platform_get_drvdata(). The driver later
> still calls scp_put(mdp->scp) unconditionally from the probe error path
> and from mdp_video_device_release(), which drops the SCP device
> reference again.
>
> Keep the fallback reference until the existing scp_put() call, so that
> the fallback path follows the same ownership rules as the scp_get()
> path.
Thanks for catching that.
> Fixes: 8f6f3aa21517 ("media: platform: mtk-mdp3: fix device leaks at probe")
This one should also go to stable:
Cc: stable@vger.kernel.org
> Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Reviewed-by: Johan Hovold <johan@kernel.org>
Johan
prev parent reply other threads:[~2026-07-06 6:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-04 17:31 [PATCH] media: platform: mtk-mdp3: Fix SCP device refcounting Guangshuo Li
2026-07-06 6:50 ` Johan Hovold [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=aktQKf4QrsnUADdf@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=hverkuil+cisco@kernel.org \
--cc=kees@kernel.org \
--cc=lgs201920130244@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=marco.crivellari@suse.com \
--cc=matthias.bgg@gmail.com \
--cc=mchehab@kernel.org \
--cc=nicolas.dufresne@collabora.com \
--cc=thomas.weissschuh@linutronix.de \
/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