From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot 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 Message-ID: In-Reply-To: <20260513120034.182-1-getshell@seu.edu.cn> References: <20260513120034.182-1-getshell@seu.edu.cn> <20260513120034.182-1-getshell@seu.edu.cn> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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()` =E2=80=94 it does NO= T call `drm_mode_config_init()` So the init/cleanup pairing should be: - `omap_modeset_init()` =E2=86=94 `omap_modeset_fini()` =E2=80=94 IRQ insta= ll/uninstall only - `drm_mode_config_init()` =E2=86=94 `drm_mode_config_cleanup()` =E2=80=94 = 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` =E2=86=92 = `omap_modeset_fini()` (which before this patch called `drm_mode_config_clea= nup()`), then falls through to `err_gem_deinit` =E2=86=92 `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_c= onfig_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_ins= tall()`. The `drm_mode_config_cleanup()` is left solely in the top-level pa= ths where it belongs. **Minor nits:** 1. The commit message line `Issue found using a prototype static analysis t= ool` lacks a `Signed-off-by`-style trailer separator =E2=80=94 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`) =E2=80=94 t= his 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 the= y only reviewed, `Reviewed-by:` would be more appropriate. 3. After the patch, `omap_modeset_fini()` becomes a trivial one-line wrappe= r around `omap_drm_irq_uninstall()`. This is fine =E2=80=94 keeping the `_i= nit`/`_fini` symmetry aids readability =E2=80=94 but a reviewer could reaso= nably suggest inlining it. Not a blocker. --- Generated by Claude Code Patch Reviewer