From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/ras: Cancel and free message on get counter failure
Date: Mon, 25 May 2026 17:57:40 +1000 [thread overview]
Message-ID: <review-patch1-20260523050212.557292-2-raag.jadav@intel.com> (raw)
In-Reply-To: <20260523050212.557292-2-raag.jadav@intel.com>
Patch Review
**Verdict: Good fix, clean implementation.**
This fixes a real leak: when `get_node_error_counter()` failed, the function returned directly without calling `genlmsg_cancel()` or `nlmsg_free()`, leaking the sk_buff and genetlink header.
The goto structure is correct:
```c
cancel_msg:
genlmsg_cancel(msg, hdr);
free_msg:
nlmsg_free(msg);
return ret;
```
- The `hdr` allocation failure path jumps to `free_msg` directly, correctly skipping `genlmsg_cancel` (since there's no valid header to cancel).
- The `get_node_error_counter` and `msg_reply_value` failure paths jump to `cancel_msg`, which cancels the header then falls through to free the message. `hdr` is guaranteed valid at this point.
- The existing `msg_reply_value` error handling had the same cancel+free sequence inline — consolidating it into the goto is a good cleanup.
No issues.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-25 7:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-23 5:00 [PATCH v2 0/4] DRM RAS Fixes Raag Jadav
2026-05-23 5:00 ` [PATCH v2 1/4] drm/ras: Cancel and free message on get counter failure Raag Jadav
2026-05-25 7:57 ` Claude Code Review Bot [this message]
2026-05-23 5:00 ` [PATCH v2 2/4] drm/xe/drm_ras: Make counter allocation drm managed Raag Jadav
2026-05-25 7:57 ` Claude review: " Claude Code Review Bot
2026-05-23 5:00 ` [PATCH v2 3/4] drm/xe/drm_ras: Add per node cleanup action Raag Jadav
2026-05-25 7:57 ` Claude review: " Claude Code Review Bot
2026-05-23 5:00 ` [PATCH v2 4/4] drm/xe/hw_error: Use HW_ERR prefix in log Raag Jadav
2026-05-25 7:57 ` Claude review: " Claude Code Review Bot
2026-05-25 7:57 ` Claude review: DRM RAS Fixes Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-05-14 20:28 [PATCH v1 0/3] " 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
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-20260523050212.557292-2-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