public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/omapdrm: avoid double drm_mode_config_cleanup()
Date: Sat, 16 May 2026 12:06:26 +1000	[thread overview]
Message-ID: <review-patch1-20260513120034.182-1-getshell@seu.edu.cn> (raw)
In-Reply-To: <20260513120034.182-1-getshell@seu.edu.cn>

Patch Review

**Verdict: The bug is real and the fix is correct.**

The code structure is:

- `drm_mode_config_init()` is called in `omapdrm_init()` at line 715
- `drm_mode_config_cleanup()` is called in the `err_gem_deinit` label (line 761) and in `omapdrm_cleanup()` (line 785)
- `omap_modeset_init()` calls `omap_drm_irq_install()` — it does NOT call `drm_mode_config_init()`

So the init/cleanup pairing should be:
- `omap_modeset_init()` ↔ `omap_modeset_fini()` — IRQ install/uninstall only
- `drm_mode_config_init()` ↔ `drm_mode_config_cleanup()` — handled at the `omapdrm_init()`/`omapdrm_cleanup()` level

**Error path double-cleanup (confirmed):** When `drm_vblank_init()` or `drm_dev_register()` fail, the error path hits `err_cleanup_modeset` → `omap_modeset_fini()` (which before this patch called `drm_mode_config_cleanup()`), then falls through to `err_gem_deinit` → `drm_mode_config_cleanup()` again.

**Normal teardown double-cleanup (confirmed):** `omapdrm_cleanup()` calls `omap_modeset_fini()` at line 782 (which before the patch called `drm_mode_config_cleanup()`), then calls `drm_mode_config_cleanup()` again at line 785.

After this patch, `omap_modeset_fini()` only calls `omap_drm_irq_uninstall()`, which correctly mirrors `omap_modeset_init()` calling `omap_drm_irq_install()`. The `drm_mode_config_cleanup()` is left solely in the top-level paths where it belongs.

**Minor nits:**

1. The commit message line `Issue found using a prototype static analysis tool` lacks a `Signed-off-by`-style trailer separator — it reads as part of the body but feels like a tagline. Convention is to either drop it or phrase it as part of the description.

2. The `Signed-off-by` from Slavin Liu (`220245772@seu.edu.cn`) — this person is listed as `Cc:` in the mail headers. If they co-developed the patch, a `Co-developed-by:` tag should precede their `Signed-off-by:` per kernel conventions (`Documentation/process/submitting-patches.rst`). If they only reviewed, `Reviewed-by:` would be more appropriate.

3. After the patch, `omap_modeset_fini()` becomes a trivial one-line wrapper around `omap_drm_irq_uninstall()`. This is fine — keeping the `_init`/`_fini` symmetry aids readability — but a reviewer could reasonably suggest inlining it. Not a blocker.

---
Generated by Claude Code Patch Reviewer

      parent reply	other threads:[~2026-05-16  2:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 12:00 [PATCH] drm/omapdrm: avoid double drm_mode_config_cleanup() Hongyan Xu
2026-05-16  2:06 ` Claude review: " Claude Code Review Bot
2026-05-16  2:06 ` Claude Code Review Bot [this message]

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-patch1-20260513120034.182-1-getshell@seu.edu.cn \
    --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