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: renesas: rz-du: rzg2l_du_encoder: convert to of_drm_find_and_get_bridge() Date: Sun, 12 Apr 2026 11:12:50 +1000 Message-ID: In-Reply-To: <20260409-drm-bridge-alloc-getput-drm_of_find_bridge-4-v5-1-d7381c07788a@bootlin.com> References: <20260409-drm-bridge-alloc-getput-drm_of_find_bridge-4-v5-0-d7381c07788a@bootlin.com> <20260409-drm-bridge-alloc-getput-drm_of_find_bridge-4-v5-1-d7381c07788a@bootlin.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 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