From: sashiko-bot@kernel.org
To: "Luca Ceresoli" <luca.ceresoli@bootlin.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 2/3] drm/vc4: dsi: stop using deprecated drmm_of_get_bridge()
Date: Tue, 13 Oct 2026 15:35:32 +0000 [thread overview]
Message-ID: <sashiko-outbox-170020@kernel.org> (raw)
In-Reply-To: <20261013-drm-fix-of_get_bridge-build-regression-v3-2-0b4c0b65be82@bootlin.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] drm/vc4: reference leak of next_bridge on component unbind/rebind
--
commit 01a94378aeae8cb42a9f68ed6384a34ccaa162a0
Author: Luca Ceresoli <luca.ceresoli@bootlin.com>
drm/vc4: dsi: stop using deprecated drmm_of_get_bridge()
drmm_of_get_bridge() is deprecated, switch to
of_drm_get_bridge_by_endpoint(). As of_drm_get_bridge_by_endpoint() returns
a refcounted bridge, ensure it is put by using bridge.next_bridge.
> diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c
> index 0148f2befed14..675bd0fc13913 100644
> --- a/drivers/gpu/drm/vc4/vc4_dsi.c
> +++ b/drivers/gpu/drm/vc4/vc4_dsi.c
[ ... ]
> @@ -1775,9 +1774,13 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
> if (ret)
> return ret;
>
> + dsi->bridge.next_bridge = drm_bridge_get(next_bridge);
> +
[Severity: Medium]
Does this code introduce a regression that leaks the bridge reference across
component unbind/rebind cycles?
During component unbind, vc4_dsi_release_action() only drops the reference
to dsi->bridge acquired during bind:
static void vc4_dsi_release_action(struct drm_device *drm, void *ptr)
{
struct vc4_dsi *dsi = ptr;
drm_bridge_put(&dsi->bridge);
}
Because dsi->bridge outlives the component unbind, __drm_bridge_free() is
not executed, and the reference to next_bridge is not automatically released.
When the component is subsequently rebound, vc4_dsi_bind() overwrites
dsi->bridge.next_bridge here without freeing the previous pointer,
permanently leaking the bridge reference. Does next_bridge need to be
explicitly cleared in the teardown path?
> ret = drm_bridge_attach(encoder, &dsi->bridge, NULL, 0);
> - if (ret)
> + if (ret) {
> + drm_bridge_clear_and_put(&dsi->bridge.next_bridge);
> return ret;
> + }
>
> return 0;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261013-drm-fix-of_get_bridge-build-regression-v3-0-0b4c0b65be82@bootlin.com?part=2
next prev parent reply other threads:[~2026-10-13 15:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 15:23 [PATCH v3 0/3] drm: remove deprecated *_of_get_bridge() from non-OF drivers Luca Ceresoli
2026-10-13 15:23 ` [PATCH v3 1/3] drm/vc4: dpi: stop using deprecated drmm_of_get_bridge() Luca Ceresoli
2026-10-13 15:23 ` [PATCH v3 2/3] drm/vc4: dsi: " Luca Ceresoli
2026-10-13 15:35 ` sashiko-bot [this message]
2026-10-13 15:56 ` Luca Ceresoli
2026-10-13 15:23 ` [PATCH v3 3/3] drm/vc4: dpi: inline vc4_dpi_init_bridge() into vc4_dpi_bind() Luca Ceresoli
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=sashiko-outbox-170020@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=luca.ceresoli@bootlin.com \
--cc=sashiko-reviews@lists.linux.dev \
/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.