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/bridge: imx8qxp-pxl2dpi: avoid ERR_PTR with device_node cleanup
Date: Thu, 07 May 2026 13:48:12 +1000	[thread overview]
Message-ID: <review-overall-20260506092324.635014-1-lgs201920130244@gmail.com> (raw)
In-Reply-To: <20260506092324.635014-1-lgs201920130244@gmail.com>

Overall Series Review

Subject: drm/bridge: imx8qxp-pxl2dpi: avoid ERR_PTR with device_node cleanup
Author: Guangshuo Li <lgs201920130244@gmail.com>
Patches: 4
Reviewed: 2026-05-07T13:48:12.371028

---

This is a correct and well-targeted single-patch fix for a real bug. The `DEFINE_FREE(device_node, ...)` cleanup macro (defined in `include/linux/of.h:138`) checks `if (_T)` before calling `of_node_put(_T)`, but does **not** filter out `IS_ERR()` values. Since ERR_PTR values are non-NULL, when `imx8qxp_pxl2dpi_get_available_ep_from_port()` returns an error, the `__free(device_node)` cleanup would call `of_node_put()` on a bogus kernel pointer — a use-after-free / invalid memory access.

The fix is minimal and correct: remove the `__free` annotation from `ep`, check `IS_ERR(ep)` before any cleanup can fire, then manually `of_node_put(ep)` once it's no longer needed. The approach is appropriate for a stable-targeted fix.

**Verdict: Looks good to me. Recommend applying.**

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-05-07  3:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06  9:23 [PATCH v5] drm/bridge: imx8qxp-pxl2dpi: avoid ERR_PTR with device_node cleanup Guangshuo Li
2026-05-06  9:50 ` Liu Ying
2026-05-06 13:58   ` Guangshuo Li
2026-05-06 14:24     ` Guangshuo Li
2026-05-07  3:48 ` Claude Code Review Bot [this message]
2026-05-07  3:48 ` Claude review: " Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-05-06 14:24 [PATCH v6] " Guangshuo Li
2026-05-07  3:23 ` Claude review: " Claude Code Review Bot
2026-05-07  3:23 ` Claude Code Review Bot
2026-05-02 11:55 [PATCH v3] " Guangshuo Li
2026-05-04 22:50 ` Claude review: " Claude Code Review Bot
2026-05-04 22:50 ` 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-20260506092324.635014-1-lgs201920130244@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