From: Thomas Zimmermann <tzimmermann@suse.de>
To: Andreas Kemnade <andreas@kemnade.info>,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
airlied@gmail.com, simona@ffwll.ch, lumag@kernel.org,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND] drm/connector: check if destroy function exist
Date: Fri, 3 Jul 2026 09:09:46 +0200 [thread overview]
Message-ID: <44557a30-dc86-409a-b430-2b4db151843b@suse.de> (raw)
In-Reply-To: <20260702191453.611070-1-andreas@kemnade.info>
Hi
Am 02.07.26 um 21:14 schrieb Andreas Kemnade:
> Connectors might have not resources needed to be manually freed.
> E.g. the drm_bridge_connector does not have such a callback.
>
> Fixes: c12907be57b1 ("drm/bridge-connector: switch to using drmm allocations")
This patch uses drmm_connector_init() for the cleanup, which is a
mis-design IMHO. Rather than calling drm_connector_cleanup(), it should
call connector->funcs->destroy, which then points to
drm_connector_cleanup. This would make the whole thing more useful and
not require fixups (like this one) elsewhere in the code. Just just my 2cts.
Best regards
Thomas
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
> ---
> drivers/gpu/drm/drm_connector.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index 47dc53c4a738..d2dfc6e8f7d0 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -198,7 +198,9 @@ static void drm_connector_free(struct kref *kref)
> struct drm_device *dev = connector->dev;
>
> drm_mode_object_unregister(dev, &connector->base);
> - connector->funcs->destroy(connector);
> +
> + if (connector->funcs->destroy)
> + connector->funcs->destroy(connector);
> }
>
> void drm_connector_free_work_fn(struct work_struct *work)
> @@ -216,7 +218,9 @@ void drm_connector_free_work_fn(struct work_struct *work)
>
> llist_for_each_entry_safe(connector, n, freed, free_node) {
> drm_mode_object_unregister(dev, &connector->base);
> - connector->funcs->destroy(connector);
> +
> + if (connector->funcs->destroy)
> + connector->funcs->destroy(connector);
> }
> }
>
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)
next prev parent reply other threads:[~2026-07-03 7:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-02 19:14 Andreas Kemnade
2026-07-03 7:09 ` Thomas Zimmermann [this message]
2026-07-28 18:36 ` Andreas Kemnade
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=44557a30-dc86-409a-b430-2b4db151843b@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@gmail.com \
--cc=andreas@kemnade.info \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lumag@kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
/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®