From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot 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 Message-ID: In-Reply-To: <20260517131742.3435209-1-michael.bommarito@gmail.com> References: <20260517131742.3435209-1-michael.bommarito@gmail.com> <20260517131742.3435209-1-michael.bommarito@gmail.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.** Looking at the function structure in `amdgpu_gem.c:1= 002-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 =3D -ENOMEM; goto out_exec; } ``` correctly routes through the existing cleanup path. **Comparison with sibling error paths:** Every other error path in this fun= ction either jumps to `out_exec` (lines 1028, 1033, 1055-1056, 1059-1060, 1= 065-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` pat= tern used for all pre-`break` errors. **One minor observation (not blocking):** The commit message mentions the p= atch was `Assisted-by: Claude:claude-opus-4-7`. This tag is not a standard = kernel tag =E2=80=94 the kernel community hasn't settled on a convention fo= r 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, correc= t, and addresses a real unprivileged local DoS. --- Generated by Claude Code Patch Reviewer