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/gma500: clean up modeset on backlight init failure Date: Mon, 25 May 2026 17:02:55 +1000 Message-ID: In-Reply-To: <20260524155735.13865-1-mhun512@gmail.com> References: <20260524155735.13865-1-mhun512@gmail.com> <20260524155735.13865-1-mhun512@gmail.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 do= wn the modeset, IRQs, MMU, etc. **Minor observation on `ret` value scope:** The variable `ret` is set insid= e the connector loop only if an LVDS or MIPI connector is found and `gma_ba= cklight_init()` is called. If no such connector exists, `ret` still holds i= ts 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 =3D drm_vblank_init(dev, dev_priv->num_pipe); if (ret) goto out_err; ``` If `drm_vblank_init()` succeeded, `ret =3D=3D 0`, so the `if (ret)` check a= t line 407 correctly falls through to the success path. This is fine =E2=80= =94 no issue here, just confirming the logic holds. **Pre-existing issue (out of scope for this patch):** At line 348-350, ther= e's another bare `return ret` that also skips `out_err`: ```c ret =3D psb_do_init(dev); if (ret) return ret; ``` This has the same class of bug =E2=80=94 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 th= is is a real resource leak fix. **Recommendation:** Apply as-is. Optionally suggest the author send a follo= w-up for the `psb_do_init()` bare return at line 349. --- Generated by Claude Code Patch Reviewer