Claude review: drm/bridge: it6505: fix use-after-free in it6505_parse_dt()

Claude Code Review Bot
2026-04-12T01:30:02Z

Overall Series Review

Subject: drm/bridge: it6505: fix use-after-free in it6505_parse_dt()
Author: Wentao Liang <vulab@iscas.ac.cn>
Patches: 1
Reviewed: 2026-04-12T11:30:02.603337

---

This is a single patch claiming to fix a use-after-free in `it6505_parse_dt()`. The identified bug is real — the original code calls `of_node_put(ep)` before `ep` is subsequently passed to `of_property_read_variable_u64_array()`, which is a use-after-free if the refcount drops to zero. However, the patch has two issues: (1) it adds a spurious `of_node_put(ep)` in the `else` branch where `ep` is guaranteed to be NULL, and (2) it fails to fix the **exact same bug** present earlier in the same function for the first `of_graph_get_endpoint_by_regs()` call.

**Verdict: Needs revision.** The core fix is correct for the second endpoint lookup, but the patch is incomplete — the same use-after-free pattern exists a few lines above and is left unfixed.