dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Luca Ceresoli" <luca.ceresoli@bootlin.com>
To: <sashiko-reviews@lists.linux.dev>,
	"Luca Ceresoli" <luca.ceresoli@bootlin.com>
Cc: <wsa+renesas@sang-engineering.com>, <imx@lists.linux.dev>,
	<Frank.Li@kernel.org>, <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH v2 3/7] drm/bridge: dw-mipi-dsi: stop using deprecated devm_drm_of_get_bridge()
Date: Wed, 30 Sep 2026 21:35:39 +0200	[thread overview]
Message-ID: <DLSWJ8V1AIC9.3D68VRRVHXJUF@bootlin.com> (raw)
In-Reply-To: <20260929135537.5E85C1F00898@smtp.kernel.org>

On Tue Sep 29, 2026 at 3:55 PM CEST, sashiko-bot wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] drm: bridge reference leak on dw_mipi_dsi_host_detach early return
> --
>
> commit b7207f37872ee6fe7eb2903e38f89975b930c392
> Author: Luca Ceresoli <luca.ceresoli@bootlin.com>
>
> drm/bridge: dw-mipi-dsi: stop using deprecated devm_drm_of_get_bridge()
>
> This commit switches from the deprecated devm_drm_of_get_bridge() to
> of_drm_get_bridge_by_endpoint() to resolve a build failure when CONFIG_OF
> is disabled. Since of_drm_get_bridge_by_endpoint() returns a refcounted
> bridge, it adds the necessary put operations to release the reference.
>
> Link: https://lore.kernel.org/r/20260928161605.2271412-1-arnd@kernel.org
> Link: https://lore.kernel.org/oe-kbuild-all/202609291109.9RGna4XZ-lkp@intel.com/
>
>> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
>> index 5dd475fcaacf8..22d1b8cbe1d57 100644
>> --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
>> +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> [ ... ]
>> @@ -368,9 +368,8 @@ static int dw_mipi_dsi_host_detach(struct mipi_dsi_host *host,
>>  			return ret;
>
> [Severity: Medium]
> If pdata->host_ops->detach() returns a negative error code (e.g., during
> device unbind or PHY teardown errors) and takes this early return, does this
> leak the bridge reference acquired in the attach function?
>
> Since the bridge is now dynamically refcounted and we skip the newly added
> drm_bridge_clear_and_put(&dsi->bridge.next_bridge), it looks like the
> reference count will not be properly decremented on this error path.

The issue was there already for drm_of_panel_bridge_remove() (here deleted)
and drm_bridge_remove().

Id say it's orthogonal, and most likely nobody has this issue in real
life. So I took a note to fix this soon, and I'd let this patch be applied
as is because it fixes an issue bothering people.

Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2026-09-30 19:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29 13:39 [PATCH v2 0/7] drm: remove deprecated *_of_get_bridge() from non-OF drivers (fixes build regression) Luca Ceresoli
2026-09-29 13:39 ` [PATCH v2 1/7] drm/imx/lcdc: stop using deprecated devm_drm_of_get_bridge() Luca Ceresoli
2026-10-01  8:02   ` Paul Cercueil
2026-09-29 13:39 ` [PATCH v2 2/7] drm: verisilicon: " Luca Ceresoli
2026-09-29 14:42   ` Icenowy Zheng
2026-09-29 21:26     ` Luca Ceresoli
2026-10-01  8:04   ` Paul Cercueil
2026-09-29 13:39 ` [PATCH v2 3/7] drm/bridge: dw-mipi-dsi: " Luca Ceresoli
2026-09-29 13:55   ` sashiko-bot
2026-09-30 19:35     ` Luca Ceresoli [this message]
2026-10-01  8:07   ` Paul Cercueil
2026-09-29 13:39 ` [PATCH v2 4/7] drm/bridge: dw-mipi-dsi2: " Luca Ceresoli
2026-10-01  8:10   ` Paul Cercueil
2026-09-29 13:39 ` [PATCH v2 5/7] drm/vc4: dpi: stop using deprecated drmm_of_get_bridge() Luca Ceresoli
2026-10-01  8:22   ` Paul Cercueil
2026-10-01  8:31     ` Luca Ceresoli
2026-09-29 13:39 ` [PATCH v2 6/7] drm/vc4: dsi: " Luca Ceresoli
2026-09-29 13:54   ` sashiko-bot
2026-10-01  8:56   ` Paul Cercueil
2026-10-01  9:02     ` Paul Cercueil
2026-09-29 13:39 ` [PATCH v2 7/7] drm: renesas: shmobile: stop using deprecated devm_drm_of_get_bridge() Luca Ceresoli
2026-10-01  9:00   ` Paul Cercueil
2026-10-01 15:49 ` [PATCH v2 0/7] drm: remove deprecated *_of_get_bridge() from non-OF drivers (fixes build regression) 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=DLSWJ8V1AIC9.3D68VRRVHXJUF@bootlin.com \
    --to=luca.ceresoli@bootlin.com \
    --cc=Frank.Li@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=imx@lists.linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=wsa+renesas@sang-engineering.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