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: renesas: rz-du: mipi_dsi: Fix return path on error
Date: Tue, 05 May 2026 09:27:22 +1000	[thread overview]
Message-ID: <review-overall-20260501132135.196701-1-chris.brandt@renesas.com> (raw)
In-Reply-To: <20260501132135.196701-1-chris.brandt@renesas.com>

Overall Series Review

Subject: drm: renesas: rz-du: mipi_dsi: Fix return path on error
Author: Chris Brandt <chris.brandt@renesas.com>
Patches: 1
Reviewed: 2026-05-05T09:27:22.127017

---

This is a single-patch series (v3) that fixes an error-handling bug in the Renesas RZ MIPI DSI probe path. The original code had two problems:

1. **Missing error unwind**: The `dma_alloc_coherent()` call was placed after `mipi_dsi_host_register()`, and on failure it did `return -ENOMEM` directly — skipping the `err_pm_disable` cleanup label, which means `pm_runtime_disable()` and `mipi_dsi_host_unregister()` were never called on that error path.

2. **Leaked DMA allocation**: Since plain `dma_alloc_coherent()` was used, any other error path that went through the `err_phy` / `err_pm_disable` labels would also leak the DMA buffer (though in practice this was unreachable since the alloc came last).

The fix is clean and correct: switch to `dmam_alloc_coherent()` (device-managed) and move it earlier in the probe function — before `platform_set_drvdata()` and `pm_runtime_enable()` — so that on failure, a simple `return -ENOMEM` is sufficient (no cleanup needed at that point), and the buffer is automatically freed on device removal. The corresponding `dma_free_coherent()` in `remove()` is correctly dropped.

The patch has a `Fixes:` tag, a `Reviewed-by` from Biju Das, is on its third revision addressing prior review feedback, and the changelog is well documented. **Recommend: Accept.**

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-05-04 23:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-01 13:21 [PATCH v3] drm: renesas: rz-du: mipi_dsi: Fix return path on error Chris Brandt
2026-05-04 23:27 ` Claude review: " Claude Code Review Bot
2026-05-04 23:27 ` Claude Code Review Bot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-04-22 14:51 [PATCH v2] " Chris Brandt
2026-04-22 21:31 ` Claude review: " Claude Code Review Bot
2026-04-22 21:31 ` 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-overall-20260501132135.196701-1-chris.brandt@renesas.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