From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/xe/drm_ras: Make counter allocation drm managed
Date: Sat, 16 May 2026 10:24:56 +1000 [thread overview]
Message-ID: <review-patch2-20260514202839.1888688-3-raag.jadav@intel.com> (raw)
In-Reply-To: <20260514202839.1888688-3-raag.jadav@intel.com>
Patch Review
**Verdict: Correct fix, minor observation.**
Switching from `kcalloc` to `drmm_kcalloc` ensures the counter array is freed automatically during drm device release, which eliminates the problem where `cleanup_node_param()` wasn't called if counter allocation itself failed in a subsequent iteration — the previous iteration's counter would be leaked.
```c
counter = drmm_kcalloc(&xe->drm, DRM_XE_RAS_ERR_COMP_MAX, sizeof(*counter), GFP_KERNEL);
```
The corresponding removal of `kfree(ras->info[severity])` from `cleanup_node_param()` is correct since drmm now owns the lifetime:
```c
- kfree(ras->info[severity]);
- ras->info[severity] = NULL;
```
**Minor observation**: When `allocate_and_copy_counters()` fails, `ras->info[severity]` is left holding an `ERR_PTR` value (set in `assign_node_params()` line 120-121). While this isn't a functional bug since the init path returns an error and nothing will dereference it, it would be cleaner to set `ras->info[severity] = NULL` after the `IS_ERR` check in `assign_node_params()`. Not a blocking issue.
---
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-16 0:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 20:28 [PATCH v1 0/3] DRM RAS Fixes Raag Jadav
2026-05-14 20:28 ` [PATCH v1 1/3] drm/ras: Cancel and free message on get counter failure Raag Jadav
2026-05-16 0:24 ` Claude review: " Claude Code Review Bot
2026-05-14 20:28 ` [PATCH v1 2/3] drm/xe/drm_ras: Make counter allocation drm managed Raag Jadav
2026-05-16 0:24 ` Claude Code Review Bot [this message]
2026-05-14 20:28 ` [PATCH v1 3/3] drm/xe/drm_ras: Add per node cleanup action Raag Jadav
2026-05-16 0:24 ` Claude review: " Claude Code Review Bot
2026-05-16 0:24 ` Claude review: DRM RAS Fixes 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-patch2-20260514202839.1888688-3-raag.jadav@intel.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