Linux clock framework development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Tomi Valkeinen" <tomi.valkeinen+renesas@ideasonboard.com>
Cc: wsa+renesas@sang-engineering.com, linux-clk@vger.kernel.org,
	devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v6 5/6] arm64: dts: renesas: sparrow-hawk: Enable DisplayPort by adding DSC
Date: Mon, 07 Sep 2026 09:43:17 +0000	[thread overview]
Message-ID: <20260907094317.F08D51F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260907-rcar-du-dsc-v6-5-f8ef711a7494@ideasonboard.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The DRM bridge reference obtained via of_drm_get_bridge_by_endpoint() is leaked on error paths and during driver removal.
--

commit a2a78077050a0efecae114552f483f67a6423d4c
Author: Marek Vasut <marek.vasut+renesas@mailbox.org>

drm/rcar-du: dsc: Add rudimentary Renesas R-Car V4H DSC driver

The Renesas DSC Display Stream Compression is a bridge embedded in the
Renesas R-Car V4H SoC. The bridge performs VESA DSC encoding of up to
8k or 400 Mpixel/s. Add rudimentary driver, which currently acts as a
pass-through bridge and allows DSI1 to be operational on R-Car V4H.

> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_dsc.c b/drivers/gpu/drm/renesas/rcar-du/rcar_dsc.c
> new file mode 100644
> index 0000000000000..1882ae34ce8f5
> --- /dev/null
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_dsc.c
[ ... ]
> +static int rcar_dsc_probe(struct platform_device *pdev)
> +{
> +	struct device *dev = &pdev->dev;
> +	struct rcar_dsc *dsc;
> +	int ret;
> +
> +	dsc = devm_drm_bridge_alloc(dev, struct rcar_dsc, bridge,
> +				    &rcar_dsc_bridge_ops);
> +	if (IS_ERR(dsc))
> +		return PTR_ERR(dsc);
> +
> +	platform_set_drvdata(pdev, dsc);
> +
> +	dsc->dev = &pdev->dev;
> +
> +	dsc->bridge.next_bridge = of_drm_get_bridge_by_endpoint(dev->of_node,
> +								1, 0);

[Severity: Medium]
Does this code leak the DRM bridge reference obtained via
of_drm_get_bridge_by_endpoint()?

If devm_drm_bridge_add() fails later in rcar_dsc_probe(), the cleanup path
fails to drop this bridge reference.

This means the memory for the downstream bridge object will never be freed.

Since driver probe errors and unbinds are cold paths that require root
privileges or hardware faults to trigger, this leaks the bridge reference
on a cold path.

> +	if (IS_ERR(dsc->bridge.next_bridge))
> +		return PTR_ERR(dsc->bridge.next_bridge);
> +
> +	dsc->bridge.of_node = dev->of_node;
> +
> +	pm_runtime_enable(&pdev->dev);
> +
> +	ret = devm_drm_bridge_add(dev, &dsc->bridge);
> +	if (ret)
> +		goto err_runtime_disable;
> +
> +	return 0;
> +
> +err_runtime_disable:
> +	pm_runtime_disable(&pdev->dev);
> +
> +	return ret;
> +}
> +
> +static void rcar_dsc_remove(struct platform_device *pdev)
> +{
> +	pm_runtime_disable(&pdev->dev);

[Severity: Medium]
Could this leak the DRM bridge reference during driver removal?

Since the reference acquired in rcar_dsc_probe() isn't dropped here,
unbinding the device will leave the struct drm_bridge kref leaked.

> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260907-rcar-du-dsc-v6-0-f8ef711a7494@ideasonboard.com?part=5

  reply	other threads:[~2026-09-07  9:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07  9:29 [PATCH v6 0/6] drm/rcar-du: Add support for DSI pipelines with DSC Tomi Valkeinen
2026-09-07  9:29 ` [PATCH v6 1/6] dt-bindings: display: bridge: Document Renesas R-Car V4H DSC bindings Tomi Valkeinen
2026-09-07  9:29 ` [PATCH v6 2/6] drm/rcar-du: dsc: Add rudimentary Renesas R-Car V4H DSC driver Tomi Valkeinen
2026-09-07  9:42   ` sashiko-bot
2026-09-07  9:29 ` [PATCH v6 3/6] drm/rcar-du: dsi: Support DSC in the pipeline Tomi Valkeinen
2026-09-07  9:44   ` sashiko-bot
2026-09-07  9:29 ` [PATCH v6 4/6] arm64: dts: renesas: r8a779g0: Add DSC Tomi Valkeinen
2026-09-08 12:11   ` Geert Uytterhoeven
2026-09-07  9:29 ` [PATCH v6 5/6] arm64: dts: renesas: sparrow-hawk: Enable DisplayPort by adding DSC Tomi Valkeinen
2026-09-07  9:43   ` sashiko-bot [this message]
2026-09-08 12:16   ` Geert Uytterhoeven
2026-09-07  9:29 ` [PATCH v6 6/6] arm64: dts: renesas: white-hawk: Add second mini-DP output support Tomi Valkeinen
2026-09-11  7:07 ` [PATCH v6 0/6] drm/rcar-du: Add support for DSI pipelines with DSC Tomi Valkeinen

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=20260907094317.F08D51F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tomi.valkeinen+renesas@ideasonboard.com \
    --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