All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Neil Armstrong" <neil.armstrong@linaro.org>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 1/2] drm/panel: Enable DSC for Visionox VTDR6130 panel
Date: Thu, 02 Jul 2026 09:51:23 +0000	[thread overview]
Message-ID: <20260702095124.033B01F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260702-topic-sm8x50-vtdr6130-dsc-v3-1-db881a3fc026@linaro.org>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Dangling pointer `dsi->dsc` causes a Use-After-Free if the panel is unbound or fails to probe.
- [Low] Typo in Kconfig keyword (`selecy` instead of `select`) causes Kconfig syntax errors and unmet dependencies.
--

commit e86a9d725d9bec9f842cd9809e7110af265ae958
Author: Jun Nie <jun.nie@linaro.org>
Subject: drm/panel: Enable DSC for Visionox VTDR6130 panel

This commit enables display compression (DSC v1.2) for the 1080x2400 Visionox
VTDR6130 AMOLED DSI panel. It configures the DSC parameters during probe and
sends the PPS payload when turning on the display.

> diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> index c0cc2bb4a3eb7..d4e6535f35957 100644
> --- a/drivers/gpu/drm/panel/Kconfig
> +++ b/drivers/gpu/drm/panel/Kconfig
> @@ -1352,6 +1352,8 @@ config DRM_PANEL_VISIONOX_VTDR6130
>  	depends on OF
>  	depends on DRM_MIPI_DSI
>  	depends on BACKLIGHT_CLASS_DEVICE
> +	select DRM_DISPLAY_DSC_HELPER
> +	selecy DRM_DISPLAY_HELPER

[Severity: Low]
This isn't a bug, but is there a typo here with "selecy" instead of "select"?
This will cause a Kconfig syntax error and leave dependencies unmet.

[ ... ]

> diff --git a/drivers/gpu/drm/panel/panel-visionox-vtdr6130.c b/drivers/gpu/drm/panel/panel-visionox-vtdr6130.c
> index 97a79411e1ecd..0cdcdbbc766da 100644
> --- a/drivers/gpu/drm/panel/panel-visionox-vtdr6130.c
> +++ b/drivers/gpu/drm/panel/panel-visionox-vtdr6130.c

[ ... ]

> @@ -269,6 +277,16 @@ static int visionox_vtdr6130_probe(struct mipi_dsi_device *dsi)
>  	ctx->dsi = dsi;
>  	mipi_dsi_set_drvdata(dsi, ctx);
>  
> +	ctx->dsc.dsc_version_major = 0x1;
> +	ctx->dsc.dsc_version_minor = 0x2;
> +	ctx->dsc.slice_height = 40;
> +	ctx->dsc.slice_width = 540;
> +	ctx->dsc.slice_count = 2;
> +	ctx->dsc.bits_per_component = 8;
> +	ctx->dsc.bits_per_pixel = 8 << 4;
> +	ctx->dsc.block_pred_enable = true;
> +
> +	dsi->dsc = &ctx->dsc;

[Severity: High]
Does this code leave a dangling pointer if the probe function fails later or 
if the driver is unbound?

In visionox_vtdr6130_probe(), dsi->dsc is assigned to &ctx->dsc, where ctx
is allocated using devm_drm_panel_alloc(). If devm_drm_panel_add() or
devm_mipi_dsi_attach() fail later in the probe function, or if the panel
driver is unbound via sysfs, devres will automatically free ctx.

However, since the mipi_dsi_device outlives the panel driver binding, dsi->dsc
is never cleared and becomes a dangling pointer. If the DSI subsystem or host
driver attempts to use it, it could result in a use-after-free.

Should dsi->dsc be explicitly cleared in the probe error paths and in a
driver remove callback?

>  	dsi->lanes = 4;
>  	dsi->format = MIPI_DSI_FMT_RGB888;
>  	dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_NO_EOT_PACKET |

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260702-topic-sm8x50-vtdr6130-dsc-v3-0-db881a3fc026@linaro.org?part=1

  reply	other threads:[~2026-07-02  9:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-02  9:36 [PATCH v3 0/2] drm/panel: couple of visionox vtdr6140 driver enhancements Neil Armstrong
2026-07-02  9:36 ` [PATCH v3 1/2] drm/panel: Enable DSC for Visionox VTDR6130 panel Neil Armstrong
2026-07-02  9:51   ` sashiko-bot [this message]
2026-07-02 12:36   ` Dmitry Baryshkov
2026-07-02  9:36 ` [PATCH v3 2/2] drm/panel: visionox-vtdr6130: switch to devm panel calls and drop remove Neil Armstrong
2026-07-02 12:37   ` Dmitry Baryshkov

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=20260702095124.033B01F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=neil.armstrong@linaro.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.