From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/mode-config: Create drm_mode_config_create_state()
Date: Sun, 22 Mar 2026 03:32:28 +1000 [thread overview]
Message-ID: <review-patch14-20260320-drm-mode-config-init-v2-14-c63f1134e76c@kernel.org> (raw)
In-Reply-To: <20260320-drm-mode-config-init-v2-14-c63f1134e76c@kernel.org>
Patch Review
**This is the key patch of the series.** Creates `drm_mode_config_create_state()` which iterates all DRM objects and creates initial state via the `atomic_create_state` callbacks, skipping objects that already have state.
**Critical issue - missing error cleanup**: When `drm_mode_config_create_state()` fails partway through (e.g., an allocation failure for a connector after planes and CRTCs already got their states allocated), the already-allocated states are not cleaned up:
```c
drm_for_each_connector_iter(connector, &conn_iter) {
...
ret = drm_mode_config_connector_create_state(connector);
if (ret)
return ret; // leaks previously allocated states
}
drm_connector_list_iter_end(&conn_iter);
```
Additionally, returning early from the `drm_for_each_connector_iter` loop without calling `drm_connector_list_iter_end()` will leak the iterator's reference. This needs to be fixed -- either `goto` to cleanup code that calls `drm_connector_list_iter_end()`, or restructure the error path.
The doc update to `drm_atomic.c` (lifetime description) is a nice clarification.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-21 17:32 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-20 16:27 [PATCH v2 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
2026-03-20 16:27 ` [PATCH v2 01/20] drm/colorop: Fix typos in the doc Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 02/20] drm/atomic: Drop drm_private_state.obj assignment from create_state Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 03/20] drm/mode-config: Mention drm_mode_config_reset() culprits Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 04/20] drm/colorop: Rename __drm_colorop_state_reset() Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 05/20] drm/colorop: Create drm_atomic_helper_colorop_create_state() Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 06/20] drm/atomic-state-helper: Fix __drm_atomic_helper_plane_reset() doc typo Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 07/20] drm/atomic-state-helper: Rename __drm_atomic_helper_plane_state_reset() Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 08/20] drm/plane: Add new atomic_create_state callback Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 09/20] drm/atomic-state-helper: Rename __drm_atomic_helper_crtc_state_reset() Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 10/20] drm/crtc: Add new atomic_create_state callback Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 11/20] drm/atomic-state-helper: Rename __drm_atomic_helper_connector_state_reset() Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 12/20] drm/hdmi: Rename __drm_atomic_helper_connector_hdmi_reset() Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 13/20] drm/connector: Add new atomic_create_state callback Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 14/20] drm/mode-config: Create drm_mode_config_create_state() Maxime Ripard
2026-03-21 17:32 ` Claude Code Review Bot [this message]
2026-03-20 16:27 ` [PATCH v2 15/20] drm/drv: Call drm_mode_config_create_state() by default Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 16/20] drm/atomic: Drop private obj state allocation Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 17/20] drm/drv: Drop drm_mode_config_reset() from our skeleton Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 18/20] drm/tidss: Drop call to drm_mode_config_reset at probe time Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 19/20] drm/tidss: Convert to atomic_create_state Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 20/20] drm/bridge_connector: " Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-21 17:32 ` Claude review: drm/atomic: Rework initial state allocation Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-03-10 16:06 [PATCH 00/14] " Maxime Ripard
2026-03-10 16:07 ` [PATCH 08/14] drm/mode-config: Create drm_mode_config_create_state() Maxime Ripard
2026-03-11 3:09 ` Claude review: " Claude Code Review 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=review-patch14-20260320-drm-mode-config-init-v2-14-c63f1134e76c@kernel.org \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/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