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/gma500: clean up modeset on backlight init failure
Date: Mon, 25 May 2026 17:02:55 +1000	[thread overview]
Message-ID: <review-patch1-20260524155735.13865-1-mhun512@gmail.com> (raw)
In-Reply-To: <20260524155735.13865-1-mhun512@gmail.com>

Patch Review

**The fix itself is correct and straightforward.**

At line 407-408 (post-patch):
```c
	if (ret)
		goto out_err;
```

This replaces the previous `return ret`, ensuring that `psb_driver_unload()` at the `out_err:` label (line 413-415) is called, which properly tears down the modeset, IRQs, MMU, etc.

**Minor observation on `ret` value scope:** The variable `ret` is set inside the connector loop only if an LVDS or MIPI connector is found and `gma_backlight_init()` is called. If no such connector exists, `ret` still holds its value from the last assignment before the loop. Looking at the code path, the last assignment to `ret` before the connector loop is at line 367:
```c
	ret = drm_vblank_init(dev, dev_priv->num_pipe);
	if (ret)
		goto out_err;
```

If `drm_vblank_init()` succeeded, `ret == 0`, so the `if (ret)` check at line 407 correctly falls through to the success path. This is fine — no issue here, just confirming the logic holds.

**Pre-existing issue (out of scope for this patch):** At line 348-350, there's another bare `return ret` that also skips `out_err`:
```c
	ret = psb_do_init(dev);
	if (ret)
		return ret;
```

This has the same class of bug — resources initialized before `psb_do_init()` (MMU page directory, scratch page, GTT, GEM) won't be cleaned up. The submitter might consider a follow-up patch for this.

**Tags review:** The Fixes tag references commit `1f90b1773` ("drm/gma500: Refactor backlight support (v2)"), which is the commit that introduced the backlight init in this location. The Cc: stable tag is appropriate since this is a real resource leak fix.

**Recommendation:** Apply as-is. Optionally suggest the author send a follow-up for the `psb_do_init()` bare return at line 349.

---
Generated by Claude Code Patch Reviewer

      parent reply	other threads:[~2026-05-25  7:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-24 15:57 [PATCH] drm/gma500: clean up modeset on backlight init failure Myeonghun Pak
2026-05-25  7:02 ` Claude review: " Claude Code Review Bot
2026-05-25  7:02 ` 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-20260524155735.13865-1-mhun512@gmail.com \
    --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