From: sashiko-bot@kernel.org
To: "Maxime Ripard" <mripard@kernel.org>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 44/59] drm/bridge: synopsys: dw-hdmi: Convert to atomic_create_state
Date: Thu, 22 Oct 2026 12:57:09 +0000 [thread overview]
Message-ID: <sashiko-outbox-181521@kernel.org> (raw)
In-Reply-To: <20261022-drm-no-more-connector-reset-v2-44-0b7e4e85b1e8@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm/bridge: dw-hdmi: missing connector cleanup in dw_hdmi_connector_create()
--
commit 79a659d48a2ba43f6a6effe5800fc818debe3d47
Author: Maxime Ripard <mripard@kernel.org>
drm/bridge: synopsys: dw-hdmi: Convert to atomic_create_state
This commit replaces the call to drm_atomic_helper_connector_reset() in
dw_hdmi_connector_create() with drm_atomic_helper_connector_create_state() to
allocate the initial connector state required by
drm_connector_attach_max_bpc_property().
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index 917cf764c9c5d..5f11707c67b5c 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -2605,7 +2605,15 @@ static int dw_hdmi_connector_create(struct dw_hdmi *hdmi)
> * drm_connector_attach_max_bpc_property() requires the
> * connector to have a state.
> */
> - drm_atomic_helper_connector_reset(connector);
> + if (!connector->state) {
> + struct drm_connector_state *conn_state;
> +
> + conn_state = drm_atomic_helper_connector_create_state(connector);
> + if (IS_ERR(conn_state))
> + return PTR_ERR(conn_state);
[Severity: High]
If drm_atomic_helper_connector_create_state() fails in
dw_hdmi_connector_create() in drivers/gpu/drm/bridge/synopsys/dw-hdmi.c,
does returning PTR_ERR(conn_state) directly leak the initialized connector
and leave &hdmi->connector linked on dev->mode_config.connector_list?
Just before allocating the state, dw_hdmi_connector_create() initializes
the unmanaged embedded connector:
drm_connector_init_with_ddc(hdmi->bridge.dev, connector,
&dw_hdmi_connector_funcs,
DRM_MODE_CONNECTOR_HDMIA,
hdmi->ddc);
which registers &connector->base in dev->mode_config.object_idr, allocates
connector->name, and adds &connector->head to
dev->mode_config.connector_list.
When dw_hdmi_connector_create() returns an error via
dw_hdmi_bridge_attach() -> drm_bridge_attach() during component binding,
dw_hdmi_bind() cleans up the bridge and component_bind() in
drivers/base/component.c releases the component devres group, freeing
struct dw_hdmi while &hdmi->connector remains on
dev->mode_config.connector_list. When the master driver later runs
drm_mode_config_cleanup() in drivers/gpu/drm/drm_mode_config.c, iterating
connector_list will dereference the already-freed &hdmi->connector.
Should this error path call drm_connector_cleanup(connector) before
returning?
> +
> + connector->state = conn_state;
> + }
>
> drm_connector_attach_max_bpc_property(connector, 8, 16);
>
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261022-drm-no-more-connector-reset-v2-0-0b7e4e85b1e8@kernel.org?part=44
next prev parent reply other threads:[~2026-10-22 12:57 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 12:30 [PATCH v2 00/59] drm/connector: Convert all drivers to atomic_create_state and remove reset Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 01/59] drm/hdmi: Change __drm_atomic_helper_connector_hdmi_state_init parameter order Maxime Ripard
2026-10-22 20:57 ` Maíra Canal
2026-10-22 12:31 ` [PATCH v2 02/59] drm/atomic-state-helper: Rename connector_tv_margins_reset to state_init Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 03/59] drm/atomic-state-helper: Rename connector_tv_reset " Maxime Ripard
2026-10-22 21:01 ` Maíra Canal
2026-10-22 12:31 ` [PATCH v2 04/59] drm/panel: Add atomic_create_state support Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 05/59] drm/amdgpu: vkms: Switch to drm_atomic_helper_connector_create_state Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 06/59] drm/aspeed: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 07/59] drm/ast: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 08/59] drm/bridge: analogix-anx6345: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 09/59] drm/bridge: analogix-anx78xx: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 10/59] drm/bridge: chrontel-ch7033: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 11/59] drm/bridge: nxp-ptn3460: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 12/59] drm/panel: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 13/59] drm/bridge: synopsys: dw-hdmi: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 14/59] drm/bridge: tc358767: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 15/59] drm/bridge: tda998x: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 16/59] drm/bridge: ti-tfp410: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 17/59] drm/exynos: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 18/59] drm/fsl-dcu: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 19/59] drm/hisilicon: hibmc: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 20/59] drm/logicvc: " Maxime Ripard
2026-10-25 10:24 ` Paul Kocialkowski
2026-10-22 12:31 ` [PATCH v2 21/59] drm/loongson: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 22/59] drm/mgag200: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 23/59] drm/mipi-dbi: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 24/59] drm/qxl: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 25/59] drm/renesas: shmobile: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 26/59] drm/sitronix: st7571: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 27/59] drm/sitronix: st7920: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 28/59] drm/sti: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 29/59] drm/sun4i: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 30/59] drm/tegra: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 31/59] drm/tests: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 32/59] drm/tiny: arcpgu: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 33/59] drm/tiny: bochs: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 34/59] drm/tiny: cirrus: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 35/59] drm/tiny: gm12u320: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 36/59] drm/tiny: pixpaper: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 37/59] drm/tiny: repaper: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 38/59] drm/tiny: sharp: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 39/59] drm/udl: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 40/59] drm/vboxvideo: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 41/59] drm/virtio: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 42/59] drm/vkms: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 43/59] drm/xen: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 44/59] drm/bridge: synopsys: dw-hdmi: Convert to atomic_create_state Maxime Ripard
2026-10-22 12:57 ` sashiko-bot [this message]
2026-10-22 12:31 ` [PATCH v2 45/59] drm/meson: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 46/59] drm/gud: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 47/59] drm/sun4i: hdmi: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 48/59] drm/sun4i: tv: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 49/59] drm/tests: hdmi: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 50/59] drm/vc4: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 51/59] drm/vc4: vec: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 52/59] drm/connector: Remove drm_atomic_helper_connector_reset() Maxime Ripard
2026-10-22 12:50 ` sashiko-bot
2026-10-22 12:31 ` [PATCH v2 53/59] drm/amdgpu: dm: Convert to atomic_create_state Maxime Ripard
2026-10-22 12:57 ` sashiko-bot
2026-10-22 16:17 ` Leo Li
2026-10-22 12:31 ` [PATCH v2 54/59] drm/ast: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 55/59] drm/i915: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 56/59] drm/nouveau: " Maxime Ripard
2026-10-22 12:55 ` sashiko-bot
2026-10-22 12:31 ` [PATCH v2 57/59] drm/tegra: " Maxime Ripard
2026-10-22 12:31 ` [PATCH v2 58/59] drm/connector: Remove __drm_atomic_helper_connector_reset() Maxime Ripard
2026-10-22 12:48 ` sashiko-bot
2026-10-22 12:31 ` [PATCH v2 59/59] drm/connector: Remove reset Maxime Ripard
2026-10-22 12:52 ` 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=sashiko-outbox-181521@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=mripard@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox