From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: misc: fastrpc: Add reference counting for fastrpc_user structure
Date: Fri, 27 Feb 2026 11:57:24 +1000 [thread overview]
Message-ID: <review-overall-20260226151121.818852-1-anandu.e@oss.qualcomm.com> (raw)
In-Reply-To: <20260226151121.818852-1-anandu.e@oss.qualcomm.com>
Overall Series Review
Subject: misc: fastrpc: Add reference counting for fastrpc_user structure
Author: Anandu Krishnan E <anandu.e@oss.qualcomm.com>
Patches: 2
Reviewed: 2026-02-27T11:57:24.514716
---
This single patch adds `kref`-based reference counting to `struct fastrpc_user` to prevent a use-after-free where `fastrpc_device_release()` frees the user structure while invoke contexts are still pending in a workqueue. The approach is fundamentally correct — each context takes a reference on the user in `fastrpc_context_alloc()` and releases it in `fastrpc_context_free()`, ensuring the user struct outlives all its contexts.
However, the patch has a **significant bug** in the placement of `kref_init()` in `fastrpc_device_open()`, which introduces a new race window. The reference counting logic is otherwise sound — the `fastrpc_channel_ctx` get/put accounting remains correctly balanced despite the structural changes.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-02-27 1:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 15:11 [PATCH v1] misc: fastrpc: Add reference counting for fastrpc_user structure Anandu Krishnan E
2026-02-26 17:50 ` Bjorn Andersson
2026-02-27 1:57 ` Claude Code Review Bot [this message]
2026-02-27 1:57 ` 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-overall-20260226151121.818852-1-anandu.e@oss.qualcomm.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