From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: misc: fastrpc: fix channel ctx ref leak when session alloc fails Date: Tue, 26 May 2026 07:21:42 +1000 Message-ID: In-Reply-To: <20260525085340.2734738-1-anandu.e@oss.qualcomm.com> References: <20260525085340.2734738-1-anandu.e@oss.qualcomm.com> <20260525085340.2734738-1-anandu.e@oss.qualcomm.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Correctness: Good.** The flow is clear: 1. `fastrpc_channel_ctx_get(cctx)` at line 1634 increments the refcount. 2. On success, `fastrpc_device_release()` eventually calls `fastrpc_channel= _ctx_put(cctx)` at line 1610. 3. On failure of `fastrpc_session_alloc()`, the early return at line 1652 s= kips the release path entirely, leaking the reference. The added `fastrpc_c= hannel_ctx_put(cctx)` before the return fixes this. **One minor style nit:** The patch removes a blank line that existed betwee= n `kfree(fl)` and `return -EBUSY`: ```c - + fastrpc_channel_ctx_put(cctx); return -EBUSY; ``` This is fine =E2=80=94 the blank line was arguably unnecessary, and inserti= ng the put call there is the logical place (after freeing `fl`, before retu= rning). The ordering is correct: `mutex_destroy` then `kfree` then `put` = =E2=80=94 the `cctx` doesn't depend on `fl` being alive, so the put can saf= ely go after the free. **No issues found.** The commit message accurately describes the problem, t= he Fixes tag references the correct commit that introduced the refcounting,= and the stable CC is warranted since this is a resource leak that could pr= event channel context cleanup. --- Generated by Claude Code Patch Reviewer