From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/vc4: fix NULL dereference in vc4_hvs_unbind
Date: Tue, 05 May 2026 08:48:38 +1000 [thread overview]
Message-ID: <review-overall-20260502121251.39206-3-thorsten.blum@linux.dev> (raw)
In-Reply-To: <20260502121251.39206-3-thorsten.blum@linux.dev>
Overall Series Review
Subject: drm/vc4: fix NULL dereference in vc4_hvs_unbind
Author: Thorsten Blum <thorsten.blum@linux.dev>
Patches: 1
Reviewed: 2026-05-05T08:48:38.566003
---
This is a single-patch fix for a real NULL pointer dereference in `vc4_hvs_unbind()`. The bug occurs because `vc4_drm_unbind()` calls `dev_set_drvdata(dev, NULL)` before the component framework's `devres_release_group()` triggers `vc4_component_unbind_all()`, which in turn calls `vc4_hvs_unbind()`. At that point, `dev_get_drvdata(master)` returns NULL, and the original code immediately dereferences it through `to_vc4_dev(drm)` and `vc4->hvs`.
The fix is correct and minimal — it moves the `vc4` and `hvs` variable initialization after a NULL check on `drm`. The pattern is appropriate for a defensive guard in a teardown path.
**Verdict: The patch looks correct and is suitable for merging.**
---
Generated by Claude Code Patch Reviewer
prev parent reply other threads:[~2026-05-04 22:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-02 12:12 [PATCH] drm/vc4: fix NULL dereference in vc4_hvs_unbind Thorsten Blum
2026-05-04 22:48 ` Claude review: " Claude Code Review Bot
2026-05-04 22:48 ` Claude Code Review Bot [this message]
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-20260502121251.39206-3-thorsten.blum@linux.dev \
--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