All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Chris Morgan" <macroalpha82@gmail.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH V5 4/6] drm/panel: anbernic-td4310: Add RG Vita Pro panel
Date: Thu, 04 Jun 2026 22:21:17 +0000	[thread overview]
Message-ID: <20260604222117.8C1AD1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260604220802.119107-5-macroalpha82@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The driver calls an undefined function `devm_drm_panel_add()`, causing a compilation failure. Furthermore, the driver lacks a `.remove` callback (or a devres action) to call `drm_panel_remove()`. If the build error is fixed by trivially substituting the standard `drm_panel_add()`, it will result in a Use-After-Free vulnerability.
--

commit 15ea49b70a00236df8f23333ccc634c4fbaf642e
Author: Chris Morgan <macromorgan@hotmail.com>

drm/panel: anbernic-td4310: Add RG Vita Pro panel

This commit adds support for the TD4310 controller IC DSI panel used in the
Anbernic RG Vita-Pro.

> diff --git a/drivers/gpu/drm/panel/panel-anbernic-td4310.c b/drivers/gpu/drm/panel/panel-anbernic-td4310.c
> new file mode 100644
> index 0000000000000..84963671e3f94
> --- /dev/null
> +++ b/drivers/gpu/drm/panel/panel-anbernic-td4310.c

[ ... ]

> +static int panel_anbernic_td4310_probe(struct mipi_dsi_device *dsi)
> +{

[ ... ]

> +	ret = drm_panel_of_backlight(&ctx->panel);
> +	if (ret)
> +		return ret;
> +
> +	devm_drm_panel_add(dev, &ctx->panel);

[Severity: High]
Does devm_drm_panel_add() exist in the kernel? It looks like this might
cause a build failure due to an undefined function.

If this is resolved by simply replacing it with drm_panel_add(), could it
result in a use-after-free on unbind? Because the panel is allocated with
devm_drm_panel_alloc() earlier, its memory will be automatically freed when
the device is unbound. If drm_panel_remove() is never called, the freed
panel would remain in the global DRM panel list, risking memory corruption
when other components traverse the list.

[ ... ]

> +static struct mipi_dsi_driver anbernic_panel_td4310_driver = {
> +	.driver = {
> +		.name = "panel-anbernic-td4310",
> +		.of_match_table = panel_anbernic_td4310_of_match,
> +	},
> +	.probe	= panel_anbernic_td4310_probe,
> +};

[Severity: High]
Would it make sense to add a .remove callback here to call
drm_panel_remove(), or perhaps register a custom devm action during probe,
to ensure the panel is properly unregistered from the subsystem on teardown?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260604220802.119107-1-macroalpha82@gmail.com?part=4

  reply	other threads:[~2026-06-04 22:21 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-04 22:07 [PATCH V5 0/6] Add Anbernic RG Vita-Pro Chris Morgan
2026-06-04 22:07 ` Chris Morgan
2026-06-04 22:07 ` [PATCH V5 1/6] dt-bindings: power: supply: sgm41542: document sgm41542 Chris Morgan
2026-06-04 22:07   ` Chris Morgan
2026-06-05 16:39   ` Conor Dooley
2026-06-05 16:39     ` Conor Dooley
2026-06-04 22:07 ` [PATCH V5 2/6] power: supply: sgm41542: Add SG Micro sgm41542 charger Chris Morgan
2026-06-04 22:07   ` Chris Morgan
2026-06-04 22:23   ` sashiko-bot
2026-06-04 22:07 ` [PATCH V5 3/6] dt-bindings: display: panel: Add Anbernic TD4310 panel Chris Morgan
2026-06-04 22:07   ` Chris Morgan
2026-06-05 16:26   ` Conor Dooley
2026-06-05 16:26     ` Conor Dooley
2026-06-04 22:07 ` [PATCH V5 4/6] drm/panel: anbernic-td4310: Add RG Vita Pro panel Chris Morgan
2026-06-04 22:07   ` Chris Morgan
2026-06-04 22:21   ` sashiko-bot [this message]
2026-06-04 22:08 ` [PATCH V5 5/6] dt-bindings: arm: rockchip: Add Anbernic RG Vita-Pro Chris Morgan
2026-06-04 22:08   ` Chris Morgan
2026-06-04 22:08 ` [PATCH V5 6/6] arm64: dts: " Chris Morgan
2026-06-04 22:08   ` Chris Morgan
2026-06-04 22:23   ` sashiko-bot

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=20260604222117.8C1AD1F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=macroalpha82@gmail.com \
    --cc=robh@kernel.org \
    --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.