From: sashiko-bot@kernel.org
To: "Liam Zuiderhoek" <zuiderhoekl@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] GPU: drm: meson inline drm_simple_encoder_init()
Date: Mon, 22 Jun 2026 18:18:06 +0000 [thread overview]
Message-ID: <20260622181806.B47491F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260622180832.28143-1-zuiderhoekl@gmail.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
New issues:
- [High] Incorrect inlining of `drm_simple_encoder_init()` omits the `funcs` parameter, passing 4 arguments to a function expecting at least 5, resulting in a severe type mismatch and a missing `drm_encoder_funcs` structure.
Pre-existing issues:
- [High] Failure to remove the DRM bridge on error paths leaves a dangling pointer in the global bridge list and permanently leaks the bridge container memory.
--
commit cff971d423a1058d9ded86a03517245fb14f47c1
Author: Liam Zuiderhoek <zuiderhoekl@gmail.com>
GPU: drm: meson inline drm_simple_encoder_init()
This patch replaces the drm_simple_encoder_init() call in the meson HDMI
encoder with a direct call to drm_encoder_init() as part of the DRM subsystem
TODO list.
> diff --git a/drivers/gpu/drm/meson/meson_encoder_hdmi.c b/drivers/gpu/drm/meson/meson_encoder_hdmi.c
> index 55c0601df3c62..48ca6874d4a01 100644
> --- a/drivers/gpu/drm/meson/meson_encoder_hdmi.c
> +++ b/drivers/gpu/drm/meson/meson_encoder_hdmi.c
> @@ -407,8 +407,8 @@ int meson_encoder_hdmi_probe(struct meson_drm *priv)
> meson_encoder_hdmi->priv = priv;
>
> /* Encoder */
> - ret = drm_simple_encoder_init(priv->drm, &meson_encoder_hdmi->encoder,
> - DRM_MODE_ENCODER_TMDS);
> + ret = drm_encoder_init(priv->drm, &meson_encoder_hdmi->encoder,
> + DRM_MODE_ENCODER_TMDS, NULL);
[Severity: High]
Does this pass the correct number of arguments to drm_encoder_init()?
Looking at drm_encoder_init() in drm_encoder.c, it expects at least five
arguments:
drm_encoder_init(dev, encoder, funcs, encoder_type, name, ...)
With only four arguments provided here in meson_encoder_hdmi_probe(), this
appears to pass the integer DRM_MODE_ENCODER_TMDS into the const struct
drm_encoder_funcs *funcs parameter, and NULL into the encoder_type parameter,
omitting the name parameter entirely.
Will this cause a build failure, or a panic when funcs->destroy is later
dereferenced?
> if (ret) {
> dev_err_probe(priv->dev, ret, "Failed to init HDMI encoder\n");
> goto err_put_node;
[Severity: High]
This isn't a bug introduced by this patch, but does this error path need to
call drm_bridge_remove() to prevent a memory leak?
Earlier in meson_encoder_hdmi_probe(), the bridge is added to the global
bridge list:
drm_bridge_add(&meson_encoder_hdmi->bridge);
If drm_encoder_init() fails and takes this goto err_put_node path, the
bridge remains in the global bridge list with an elevated refcount because
drm_bridge_remove() is not called.
Could this leave an orphaned bridge that permanently breaks the display
pipeline on subsequent probe retries?
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260622180832.28143-1-zuiderhoekl@gmail.com?part=1
prev parent reply other threads:[~2026-06-22 18:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-22 18:08 [PATCH] GPU: drm: meson inline drm_simple_encoder_init() Liam Zuiderhoek
2026-06-22 18:18 ` sashiko-bot [this message]
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=20260622181806.B47491F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=zuiderhoekl@gmail.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 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.