All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Osama Abdelkader" <osama.abdelkader@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 1/6] drm/panel: Use devm_mipi_dsi_attach in BOE panels
Date: Wed, 12 Aug 2026 13:13:23 +0000	[thread overview]
Message-ID: <20260812131323.E7A531F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260812130429.16850-1-osama.abdelkader@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Missing drm_panel_remove() on devm_mipi_dsi_attach() error path in boe_bf060y8m_aj0_probe() causes a dangling pointer and use-after-free.
--

--- Patch [1]: [PATCH v3 1/6] drm/panel: Use devm_mipi_dsi_attach in BOE panels ---
commit 1f4d2947471e6cb49ce506f1077843c672e21899
Author: Osama Abdelkader <osama.abdelkader@gmail.com>

drm/panel: Use devm_mipi_dsi_attach in BOE panels

Use the managed MIPI DSI attach helper in BOE panel drivers and drop the
corresponding manual detach calls from remove paths.

> diff --git a/drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c b/drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c
> index 84c21c62a43e4..6a74523a66141 100644
> --- a/drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c
> +++ b/drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c
> @@ -359,7 +359,7 @@ static int boe_bf060y8m_aj0_probe(struct mipi_dsi_device *dsi)
>  
>  	drm_panel_add(&boe->panel);
>  
> -	ret = mipi_dsi_attach(dsi);
> +	ret = devm_mipi_dsi_attach(&dsi->dev, dsi);
>  	if (ret < 0) {
>  		dev_err(dev, "Failed to attach to DSI host: %d\n", ret);
>  		return ret;

[Severity: High]
This is a pre-existing issue, but should drm_panel_remove(&boe->panel) be
called on this error path?

In boe_bf060y8m_aj0_probe(), drm_panel_add() inserts the panel into the
global panel_list. If devm_mipi_dsi_attach() fails, the function returns an
error without calling drm_panel_remove().

During probe failure, the devres cleanup drops the panel's refcount but it
remains in the global panel_list since the refcount doesn't reach zero. If
another driver later looks up this panel (e.g., via of_drm_find_panel())
and invokes its operations, it will dereference freed devres-managed resources
like boe->reset_gpio, causing a use-after-free.

Other BOE panel drivers updated in this patch seem to correctly handle this
cleanup.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260812130429.16850-1-osama.abdelkader@gmail.com?part=1

  parent reply	other threads:[~2026-08-12 13:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12 13:04 [PATCH v3 1/6] drm/panel: Use devm_mipi_dsi_attach in BOE panels Osama Abdelkader
2026-08-12 13:04 ` [PATCH v3 2/6] drm/panel: Use devm_mipi_dsi_attach in Samsung panels Osama Abdelkader
2026-08-12 13:04 ` [PATCH v3 3/6] drm/panel: Use devm_mipi_dsi_attach in Novatek and Raydium panels Osama Abdelkader
2026-08-12 13:16   ` sashiko-bot
2026-08-12 13:04 ` [PATCH v3 4/6] drm/panel: Use devm_mipi_dsi_attach in Himax and Ilitek panels Osama Abdelkader
2026-08-12 13:13   ` sashiko-bot
2026-08-12 13:04 ` [PATCH v3 5/6] drm/panel: Use devm_mipi_dsi_attach in display vendor panels Osama Abdelkader
2026-08-12 13:12   ` sashiko-bot
2026-08-12 13:04 ` [PATCH v3 6/6] drm/panel: Use devm_mipi_dsi_attach in assorted panels Osama Abdelkader
2026-08-12 13:18   ` sashiko-bot
2026-08-12 13:13 ` sashiko-bot [this message]
2026-08-12 13:26 ` [PATCH v3 1/6] drm/panel: Use devm_mipi_dsi_attach in BOE panels Maxime Ripard
2026-08-12 13:45   ` Luca Ceresoli
2026-08-12 14:23     ` Osama Abdelkader

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=20260812131323.E7A531F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=osama.abdelkader@gmail.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.