All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Maxime Ripard" <mripard@kernel.org>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 62/64] drm/vmwgfx: Switch to drm_mode_config_create_initial_state
Date: Mon, 16 Nov 2026 11:08:19 +0000	[thread overview]
Message-ID: <sashiko-outbox-216845@kernel.org> (raw)
In-Reply-To: <20261116-drm-no-more-config-reset-v2-62-0bb471f4d1e0@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/vmwgfx: leak of ldu_priv in vmw_kms_init() on initial
  state error
--

commit 5f937b8ad11b4bd1a6956c12405bef9b28767c1f
Author: Maxime Ripard <mripard@kernel.org>

drm/vmwgfx: Switch to drm_mode_config_create_initial_state

This commit replaces the drm_mode_config_reset() calls in the individual
display unit init functions with a single
drm_mode_config_create_initial_state() call in vmw_kms_init().

> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> index 90ab9380d8830..4924649033bb7 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> @@ -1175,11 +1175,23 @@ int vmw_kms_init(struct vmw_private *dev_priv)
>  		if (ret) /* Fallback */
>  			ret = vmw_kms_ldu_init_display(dev_priv);
>  	}
> +	if (ret)
> +		return ret;
> +
>  	BUILD_BUG_ON(ARRAY_SIZE(display_unit_names) != (vmw_du_max + 1));
>  	drm_info(&dev_priv->drm, "%s display unit initialized\n",
>  		 display_unit_names[dev_priv->active_display_unit]);
>  
> -	return ret;
> +	/*
> +	 * Create the initial state once, after the display unit that will
> +	 * be used has been settled on: a failure in one of the display
> +	 * unit initialization functions is used as a fallback condition to
> +	 * try the next one, and creating the state on a partially
> +	 * initialized device would both leave the KMS objects of the two
> +	 * backends on the same drm_device and trip WARN_ON() on the objects
> +	 * that don't have a state.
> +	 */
> +	return drm_mode_config_create_initial_state(dev);
>  }

[Severity: Medium]
Does this leak dev_priv->ldu_priv if drm_mode_config_create_initial_state()
fails after falling back to vmw_kms_ldu_init_display()?

vmw_kms_ldu_init_display() allocates dev_priv->ldu_priv with kmalloc_obj(),
which is only freed by vmw_kms_close() -> vmw_kms_ldu_close_display(). When
vmw_kms_init() returns an error here, vmw_driver_load() jumps to out_no_kms
and skips vmw_kms_close().

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261116-drm-no-more-config-reset-v2-0-0bb471f4d1e0@kernel.org?part=62

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

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 10:30 [PATCH v2 00/64] drm: Switch drivers to drm_mode_config_create_initial_state Maxime Ripard
2026-11-16 10:30 ` Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 01/64] drm/adp: Switch " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 02/64] drm/amdgpu: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 03/64] drm/hdlcd: Fix drm_atomic_helper_shutdown() on the probe error path Maxime Ripard
2026-11-16 18:10   ` Liviu Dudau
2026-11-16 10:30 ` [PATCH v2 04/64] drm/hdlcd: Switch to drm_mode_config_create_initial_state Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 05/64] drm/armada: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 06/64] drm/ast: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 07/64] drm/exynos: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 08/64] drm/fsl-dcu: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 09/64] drm/hisilicon/hibmc: Remove hibmc_unload() from the load error path Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 10/64] drm/hisilicon/hibmc: Switch to drm_mode_config_create_initial_state Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 11/64] drm/hyperv: " Maxime Ripard
2026-11-17 13:07   ` Hamza Mahfooz
2026-11-16 10:30 ` [PATCH v2 12/64] drm/imx/ipuv3: " Maxime Ripard
2026-11-16 11:40   ` Philipp Zabel
2026-11-16 10:30 ` [PATCH v2 13/64] drm/ingenic: Move the private object creation before the reset Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 14/64] drm/ingenic: Switch to drm_mode_config_create_initial_state Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 15/64] drm/kmb: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 16/64] drm/logicvc: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 17/64] drm/loongson: " Maxime Ripard
2026-11-16 10:53   ` sashiko-bot
2026-11-16 10:30 ` [PATCH v2 18/64] drm/mediatek: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 19/64] drm/mgag200: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 20/64] drm/msm: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 21/64] drm/nouveau: " Maxime Ripard
2026-11-16 10:30   ` Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 22/64] drm/omap: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 23/64] drm/qxl: Destroy the monitors object on the modeset init error path Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 24/64] drm/qxl: Switch to drm_mode_config_create_initial_state Maxime Ripard
2026-11-16 10:52   ` sashiko-bot
2026-11-16 10:30 ` [PATCH v2 25/64] drm/rcar-du: " Maxime Ripard
2026-11-17 23:53   ` Laurent Pinchart
2026-11-16 10:30 ` [PATCH v2 26/64] drm/rz-du: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 27/64] drm/shmobile: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 28/64] drm/st7571: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 29/64] drm/st7586: " Maxime Ripard
2026-11-17 14:03   ` David Lechner
2026-11-16 10:30 ` [PATCH v2 30/64] drm/st7735r: " Maxime Ripard
2026-11-17 14:03   ` David Lechner
2026-11-16 10:30 ` [PATCH v2 31/64] drm/st7920: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 32/64] drm/sprd: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 33/64] drm/sti: Fix drm_atomic_helper_shutdown() on the bind error paths Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 34/64] drm/sti: Move drm_mode_config_create_initial_state() before drm_dev_register() Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 35/64] drm/stm: Switch to drm_mode_config_create_initial_state Maxime Ripard
2026-11-16 14:50   ` Raphael Gallais-Pou
2026-11-16 10:30 ` [PATCH v2 36/64] drm/sun4i: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 37/64] drm/tegra: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 38/64] drm/tests: drm_atomic_state_test: " Maxime Ripard
2026-11-16 10:55   ` sashiko-bot
2026-11-16 10:30 ` [PATCH v2 39/64] drm/tests: drm_atomic_test: " Maxime Ripard
2026-11-16 10:53   ` sashiko-bot
2026-11-16 10:30 ` [PATCH v2 40/64] drm/tests: drm_bridge_test: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 41/64] drm/tests: drm_hdmi_state_helper_test: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 42/64] drm/tidss: " Maxime Ripard
2026-11-16 10:30 ` [PATCH v2 43/64] drm/tilcdc: " Maxime Ripard
2026-11-16 11:10   ` sashiko-bot
2026-11-16 10:31 ` [PATCH v2 44/64] drm/arcpgu: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 45/64] drm/bochs: " Maxime Ripard
2026-11-16 10:55   ` sashiko-bot
2026-11-16 10:31 ` [PATCH v2 46/64] drm/cirrus-qemu: " Maxime Ripard
2026-11-16 10:54   ` sashiko-bot
2026-11-16 10:31 ` [PATCH v2 47/64] drm/gm12u320: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 48/64] drm/hx8357d: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 49/64] drm/ili9163: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 50/64] drm/ili9225: " Maxime Ripard
2026-11-17 14:03   ` David Lechner
2026-11-16 10:31 ` [PATCH v2 51/64] drm/ili9341: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 52/64] drm/ili9486: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 53/64] drm/mi0283qt: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 54/64] drm/panel-mipi-dbi: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 55/64] drm/pixpaper: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 56/64] drm/repaper: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 57/64] drm/sharp-memory: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 58/64] drm/udl: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 59/64] drm/vboxvideo: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 60/64] drm/verisilicon: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 61/64] drm/virtio: " Maxime Ripard
2026-11-16 11:01   ` sashiko-bot
2026-11-16 10:31 ` [PATCH v2 62/64] drm/vmwgfx: " Maxime Ripard
2026-11-16 11:08   ` sashiko-bot [this message]
2026-11-17  6:52   ` Zack Rusin
2026-11-16 10:31 ` [PATCH v2 63/64] drm/xen: " Maxime Ripard
2026-11-16 10:31 ` [PATCH v2 64/64] drm/xlnx: " Maxime Ripard
2026-11-17 13:22 ` [PATCH v2 00/64] drm: Switch drivers " Thomas Zimmermann
2026-11-17 13:22   ` Thomas Zimmermann

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-216845@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 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.