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 38/64] drm/tests: drm_atomic_state_test: Switch to drm_mode_config_create_initial_state
Date: Mon, 16 Nov 2026 10:55:29 +0000	[thread overview]
Message-ID: <sashiko-outbox-216798@kernel.org> (raw)
In-Reply-To: <20261116-drm-no-more-config-reset-v2-38-0bb471f4d1e0@kernel.org>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] drm/tests: ERR_PTR dereference after
  drm_atomic_test_init_drm_components()
- [Low] drm/tests: commit subject uses stale drm_atomic_state_test
  prefix
--

commit 764d6a07d978e1acc8e6005af10238d412ddeb08
Author: Maxime Ripard <mripard@kernel.org>

drm/tests: drm_atomic_state_test: Switch to drm_mode_config_create_initial_state

This commit switches drm_atomic_test_init_drm_components() from
drm_mode_config_reset() to drm_mode_config_create_initial_state() for
initial KMS state creation.

> drm/tests: drm_atomic_state_test: Switch to drm_mode_config_create_initial_state

[Severity: Low]
This isn't a bug, but 5164f7e7ff8e ("drm: Rename struct drm_atomic_state
to drm_atomic_commit") renamed this test file to
drm_atomic_commit_test.c, so the subject prefix still refers to the old
name.

> diff --git a/drivers/gpu/drm/tests/drm_atomic_commit_test.c b/drivers/gpu/drm/tests/drm_atomic_commit_test.c
> index 6ccb001f6264b..97f60ce68b3e4 100644
> --- a/drivers/gpu/drm/tests/drm_atomic_commit_test.c
> +++ b/drivers/gpu/drm/tests/drm_atomic_commit_test.c
> @@ -134,7 +134,9 @@ drm_atomic_test_init_drm_components(struct kunit *test, bool has_connectors)
>  	}
>  
>  done:
> -	drm_mode_config_reset(drm);
> +	ret = drm_mode_config_create_initial_state(drm);
> +	if (ret)
> +		return ERR_PTR(ret);
>  
>  	return priv;
>  }

[Severity: Medium]
Can returning ERR_PTR(ret) here lead to an error pointer dereference in
the callers?

Every earlier step in drm_atomic_test_init_drm_components() aborts via
KUNIT_ASSERT_*, and the callers only check KUNIT_ASSERT_NOT_NULL(test,
priv) before passing priv to set_up_atomic_state(), which dereferences
priv->crtc:

drivers/gpu/drm/tests/drm_atomic_commit_test.c:drm_test_check_connector_changed_modeset() {
	...
	priv = drm_atomic_test_init_drm_components(test, true);
	KUNIT_ASSERT_NOT_NULL(test, priv);

	/* First, do a modeset to set the connector */
	ret = set_up_atomic_state(test, priv, &priv->connectors[0], &ctx);
	...
}

Using KUNIT_ASSERT_EQ(test, ret, 0) here matches the rest of the helper,
and it looks like that change was accidentally squashed into the
following commit "drm/tests: drm_atomic_test: Switch to
drm_mode_config_create_initial_state".

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

  reply	other threads:[~2026-11-16 10:55 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 [this message]
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
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-216798@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.