From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/amdgpu: fix lock leak on ENOMEM in AMDGPU_GEM_OP_GET_MAPPING_INFO
Date: Mon, 18 May 2026 16:08:14 +1000 [thread overview]
Message-ID: <review-patch1-20260517131742.3435209-1-michael.bommarito@gmail.com> (raw)
In-Reply-To: <20260517131742.3435209-1-michael.bommarito@gmail.com>
Patch Review
**Correctness: Good.** Looking at the function structure in `amdgpu_gem.c:1002-1141`:
1. At line 1016, `drm_gem_object_lookup()` acquires a reference on `gobj`.
2. At lines 1022-1036, `drm_exec_init()` + `drm_exec_lock_obj()` + `amdgpu_vm_lock_pd()` acquire locks tracked by `exec`.
3. The `out_exec` label at line 1137-1140 properly cleans up both via `drm_exec_fini(&exec)` and `drm_gem_object_put(gobj)`.
The original code at the `kvcalloc` failure:
```c
if (!vm_entries)
return -ENOMEM;
```
skips both cleanup calls. The fix:
```c
if (!vm_entries) {
r = -ENOMEM;
goto out_exec;
}
```
correctly routes through the existing cleanup path.
**Comparison with sibling error paths:** Every other error path in this function either jumps to `out_exec` (lines 1028, 1033, 1055-1056, 1059-1060, 1065-1066) or calls `drm_exec_fini(&exec)` inline before the `break` (lines 1047, 1079, 1119, 1131). The fix is consistent with the `goto out_exec` pattern used for all pre-`break` errors.
**One minor observation (not blocking):** The commit message mentions the patch was `Assisted-by: Claude:claude-opus-4-7`. This tag is not a standard kernel tag — the kernel community hasn't settled on a convention for AI-assisted patches. Some maintainers may request removal or conversion. This is a social/process concern, not a code correctness issue.
**No issues found with the code change itself.** The fix is minimal, correct, and addresses a real unprivileged local DoS.
---
Generated by Claude Code Patch Reviewer
prev parent reply other threads:[~2026-05-18 6:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-17 13:17 [PATCH] drm/amdgpu: fix lock leak on ENOMEM in AMDGPU_GEM_OP_GET_MAPPING_INFO Michael Bommarito
2026-05-18 6:08 ` Claude review: " Claude Code Review Bot
2026-05-18 6:08 ` Claude Code Review Bot [this message]
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-20260517131742.3435209-1-michael.bommarito@gmail.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