From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/imagination: Fix segfault when updating ftrace mask
Date: Tue, 28 Apr 2026 15:07:03 +1000 [thread overview]
Message-ID: <review-patch1-20260427-ftrace_fix-v3-1-e081530759a8@imgtec.com> (raw)
In-Reply-To: <20260427-ftrace_fix-v3-1-e081530759a8@imgtec.com>
Patch Review
**Verdict: Good to merge.**
The fix is correct and minimal. Looking at the current source (`pvr_fw_trace.c`), the debugfs get/set functions both expect `struct pvr_device *`:
```c
static int pvr_fw_trace_mask_get(void *data, u64 *value)
{
struct pvr_device *pvr_dev = data;
*value = pvr_dev->fw_dev.fw_trace.group_mask;
return 0;
}
static int pvr_fw_trace_mask_set(void *data, u64 value)
{
struct pvr_device *pvr_dev = data;
...
}
```
But the buggy code passed `fw_trace` (a `struct pvr_fw_trace *`):
```c
- debugfs_create_file("trace_mask", 0600, dir, fw_trace,
+ debugfs_create_file("trace_mask", 0600, dir, pvr_dev,
&pvr_fw_trace_mask_fops);
```
When `pvr_fw_trace_mask_set` then dereferences `pvr_dev->fw_dev.fw_trace.group_mask` using the mistyped pointer, it reads/writes garbage memory, causing the NULL pointer dereference shown in the crash log. The fix correctly passes `pvr_dev` which is already available as the function parameter.
The `Fixes:` tag (`a331631496a0 "drm/imagination: Simplify module parameters"`) is appropriate — that commit presumably changed the private data from `pvr_dev` to `fw_trace` as part of a refactor, introducing the regression.
The crash trace in the commit message is helpful for backporting and triage. No concerns.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-04-28 5:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 5:31 [PATCH v3 0/2] drm/imagination: FW trace bug fix and configuration update Brajesh Gupta
2026-04-27 5:31 ` [PATCH v3 1/2] drm/imagination: Fix segfault when updating ftrace mask Brajesh Gupta
2026-04-28 5:07 ` Claude Code Review Bot [this message]
2026-04-27 5:31 ` [PATCH v3 2/2] drm/imagination: Restrict init_fw_trace_mask module param to read only Brajesh Gupta
2026-04-28 5:07 ` Claude review: " Claude Code Review Bot
2026-04-27 13:00 ` [PATCH v3 0/2] drm/imagination: FW trace bug fix and configuration update Alessio Belle
2026-04-27 13:25 ` (subset) " Matt Coster
2026-04-27 13:28 ` Matt Coster
2026-04-28 5:07 ` Claude review: " 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-20260427-ftrace_fix-v3-1-e081530759a8@imgtec.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