From: sashiko-bot@kernel.org
To: "Maxime Ripard" <mripard@kernel.org>
Cc: dri-devel@lists.freedesktop.org,
linux-amlogic@lists.infradead.org, neil.armstrong@linaro.org
Subject: Re: [PATCH v2 54/78] drm/meson: encoder_cvbs: Switch to atomic_create_state
Date: Fri, 14 Aug 2026 01:22:34 +0000 [thread overview]
Message-ID: <20260814012235.6905A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260608-drm-no-more-bridge-reset-v2-54-0a91018bf886@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Missing drm_bridge_remove() on error paths in meson_encoder_cvbs_probe leads to a leaked bridge, leaked 'next_bridge' reference, and a dangling pointer in the global bridge_list.
--
--- Patch [54]: [PATCH v2 54/78] drm/meson: encoder_cvbs: Switch to atomic_create_state ---
commit 495782f6fcc8d5b1c7e6fd45af9f1be19848e42c
Author: Maxime Ripard <mripard@kernel.org>
drm/meson: encoder_cvbs: Switch to atomic_create_state
This commit switches the meson_encoder_cvbs bridge from the deprecated
atomic_reset callback to the atomic_create_state callback.
> diff --git a/drivers/gpu/drm/meson/meson_encoder_cvbs.c b/drivers/gpu/drm/meson/meson_encoder_cvbs.c
> --- a/drivers/gpu/drm/meson/meson_encoder_cvbs.c
> +++ b/drivers/gpu/drm/meson/meson_encoder_cvbs.c
> @@ -215,7 +215,7 @@ static const struct drm_bridge_funcs meson_encoder_cvbs_bridge_funcs = {
> .atomic_check = meson_encoder_cvbs_atomic_check,
> .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
> .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
> - .atomic_reset = drm_atomic_helper_bridge_reset,
> + .atomic_create_state = drm_atomic_helper_bridge_create_state,
> };
>
> int meson_encoder_cvbs_probe(struct meson_drm *priv)
> {
[ ... ]
> drm_bridge_add(&meson_encoder_cvbs->bridge);
>
> meson_encoder_cvbs->priv = priv;
>
> /* Encoder */
> ret = drm_simple_encoder_init(priv->drm, &meson_encoder_cvbs->encoder,
> DRM_MODE_ENCODER_TVDAC);
> if (ret)
> return dev_err_probe(priv->dev, ret,
> "Failed to init CVBS encoder\n");
[Severity: High]
This is a pre-existing issue, but does this error path leak the bridge?
If drm_simple_encoder_init() fails, the function returns directly without
calling drm_bridge_remove(). It looks like this leaves the bridge object
in the global bridge_list.
Could this lead to a use-after-free or kernel oops if the driver module
is unloaded and another subsystem iterates over the list? Should there
be a cleanup path here for drm_bridge_add() and the next_bridge reference?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260608-drm-no-more-bridge-reset-v2-0-0a91018bf886@kernel.org?part=54
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2026-08-14 1:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 14:35 [PATCH v2 00/78] drm/bridge: Convert all reset users to create_state Maxime Ripard
2026-06-08 14:36 ` [PATCH v2 54/78] drm/meson: encoder_cvbs: Switch to atomic_create_state Maxime Ripard
2026-08-14 1:22 ` sashiko-bot [this message]
2026-06-08 14:36 ` [PATCH v2 55/78] drm/meson: encoder_dsi: " Maxime Ripard
2026-06-08 14:36 ` [PATCH v2 56/78] drm/meson: encoder_hdmi: " Maxime Ripard
2026-08-14 1:35 ` sashiko-bot
2026-06-18 11:20 ` [PATCH v2 00/78] drm/bridge: Convert all reset users to create_state Maxime Ripard
2026-06-18 13:38 ` 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=20260814012235.6905A1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=mripard@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®