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: rzg2l_du_encoder: convert to of_drm_find_and_get_bridge()
Date: Sun, 12 Apr 2026 11:12:50 +1000	[thread overview]
Message-ID: <review-patch1-20260409-drm-bridge-alloc-getput-drm_of_find_bridge-4-v5-1-d7381c07788a@bootlin.com> (raw)
In-Reply-To: <20260409-drm-bridge-alloc-getput-drm_of_find_bridge-4-v5-1-d7381c07788a@bootlin.com>

Patch Review

**Status: Good to merge.**

This is the simpler of the two patches since `bridge` is purely a local variable with no long-lived storage.

**Refcounting analysis:**

*Panel-bridge path:*
- `devm_drm_panel_bridge_add_typed()` returns a bridge with one devres-managed reference
- `drm_bridge_get(bridge)` takes a second reference for the `__free` to put at function exit
- `drm_bridge_attach()` takes its own reference (per the earlier work in step 1.D)
- On success: `__free` puts the `drm_bridge_get` reference; attach holds its own; devres holds its own. Balanced.

*of_drm_find_and_get_bridge path:*
- `of_drm_find_and_get_bridge()` returns with one reference
- `drm_bridge_attach()` takes another
- On success: `__free` puts the find reference; attach holds its own. Balanced.

*Error paths:*
```c
if (IS_ERR(bridge))
    return PTR_ERR(no_free_ptr(bridge));
```
`no_free_ptr()` nullifies `bridge` before the `__free` cleanup runs, correctly preventing `drm_bridge_put()` from being called on an `ERR_PTR`. This is correct.

The `!bridge` (NULL) return path from `of_drm_find_and_get_bridge` is also safe since `DEFINE_FREE` checks `if (_T)`.

**Comment quality:** The comment explaining the extra `drm_bridge_get()` is clear and helpful.

No issues.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-04-12  1:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-09 13:23 [PATCH v5 0/2] drm/bridge: convert users of of_drm_find_bridge(), part 4 Luca Ceresoli
2026-04-09 13:23 ` [PATCH v5 1/2] drm: renesas: rz-du: rzg2l_du_encoder: convert to of_drm_find_and_get_bridge() Luca Ceresoli
2026-04-12  1:12   ` Claude Code Review Bot [this message]
2026-04-09 13:23 ` [PATCH v5 2/2] drm: rcar-du: encoder: " Luca Ceresoli
2026-04-12  1:12   ` Claude review: " Claude Code Review Bot
2026-04-12  1:12 ` Claude review: drm/bridge: convert users of of_drm_find_bridge(), part 4 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-patch1-20260409-drm-bridge-alloc-getput-drm_of_find_bridge-4-v5-1-d7381c07788a@bootlin.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