All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Baoli Zhang" <baoli.zhang@linux.intel.com>,
	intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/xe/display: Free the KMS objects on DRM device release
Date: Mon, 16 Nov 2026 01:54:58 +0000	[thread overview]
Message-ID: <sashiko-outbox-216019@kernel.org> (raw)
In-Reply-To: <20261116011504.3910139-4-baoli.zhang@linux.intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/xe/display: double encoder->remove() on
  xe_display_init_early() error
--

commit b715fa7a2b526531416f015bc7f326dd1dd557ca
Author: Baoli Zhang <baoli.zhang@linux.intel.com>

drm/xe/display: Free the KMS objects on DRM device release

This commit removes the calls to intel_display_driver_mode_config_cleanup()
from xe_display_fini_early() and the xe_display_init_early() error path so
that KMS objects are freed by drmm on DRM device release.

> diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c
> index 8f02317a62120..639c2f5aeb66f 100644
> --- a/drivers/gpu/drm/xe/display/xe_display.c
> +++ b/drivers/gpu/drm/xe/display/xe_display.c

[ ... ]

> @@ -111,7 +114,6 @@ int xe_display_init_early(struct xe_device *xe)
>  	return devm_add_action_or_reset(xe->drm.dev, xe_display_fini_early, xe);
>  err_noirq:
>  	intel_display_driver_remove_noirq(display);
> -	intel_display_driver_mode_config_cleanup(display);
>  	intel_display_power_cleanup(display);
>  
>  	return err;

[Severity: Medium]
Can the err_noirq path in xe_display_init_early() invoke encoder->remove()
twice on each encoder when intel_display_driver_probe_nogem() fails?

In intel_display_driver_probe_nogem(), if intel_dp_tunnel_mgr_init() fails
after intel_setup_outputs(), the err_mode_config path calls
intel_mode_config_cleanup() -> intel_encoder_remove_all(). Because
drm_mode_config_cleanup() is now deferred to drmm, the encoders remain
linked on display->drm->mode_config.encoder_list when
intel_display_driver_probe_nogem() returns an error.

The err_noirq path here then calls intel_display_driver_remove_noirq() ->
intel_mode_config_cleanup() -> intel_encoder_remove_all() a second time on
the still-populated encoder_list. On the first pass,
intel_ddi_encoder_remove() frees dig_port->tc and sets it to NULL in
intel_tc_port_cleanup() and frees intel_dp->aux.name in
intel_dp_aux_fini(), so the second pass causes a NULL pointer dereference
in intel_tc_port_suspend() and a double free of intel_dp->aux.name.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261116011504.3910139-1-baoli.zhang@linux.intel.com?part=3

  reply	other threads:[~2026-11-16  1:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16  1:15 [PATCH 0/3] drm/xe/display: Free the KMS objects on DRM device release, not on unbind Baoli Zhang
2026-11-16  1:15 ` [PATCH 1/3] drm/i915/display: Tear down encoder hardware state in a separate hook Baoli Zhang
2026-11-16  1:38   ` sashiko-bot
2026-11-16  1:15 ` [PATCH 2/3] drm/i915/display: Let the drivers free the KMS objects Baoli Zhang
2026-11-16  1:53   ` sashiko-bot
2026-11-16  8:39   ` Jani Nikula
2026-11-17  1:41     ` Zhang, Baoli
2026-11-16  1:15 ` [PATCH 3/3] drm/xe/display: Free the KMS objects on DRM device release Baoli Zhang
2026-11-16  1:54   ` sashiko-bot [this message]
2026-11-16  1:35 ` ✓ CI.KUnit: success for drm/xe/display: Free the KMS objects on DRM device release, not on unbind Patchwork
2026-11-16  2:08 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-16  2:39 ` ✗ i915.CI.BAT: failure " Patchwork
2026-11-16  3:20 ` ✗ Xe.CI.FULL: " Patchwork

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-216019@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=baoli.zhang@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.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 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.