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 init ordering in amdgpu_vram_mgr_init() Date: Sat, 16 May 2026 14:48:42 +1000 Message-ID: In-Reply-To: <20260511173008.36526-2-thomas.hellstrom@linux.intel.com> References: <20260511173008.36526-1-thomas.hellstrom@linux.intel.com> <20260511173008.36526-2-thomas.hellstrom@linux.intel.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review **Verdict: Good, correct fix.** The bug is real and well described. In the current code at `amdgpu_vram_mgr.c:921`, `drmm_cgroup_register_region()` is called before `INIT_LIST_HEAD()` (lines 928-930) and `gpu_buddy_init()` (line 934). If registration fails, `adev->mman.initialized` is already true, so teardown calls `amdgpu_vram_mgr_fini()` which dereferences NULL list head pointers and uninitialized buddy allocator state. The fix correctly moves registration to after all initialization. If registration fails at the new location, the buddy allocator and lists are properly initialized, so `amdgpu_vram_mgr_fini()` can safely clean them up. The `Cc: stable` tag for v6.14+ is appropriate since the bug was introduced by commit `2b624a2c1865`. No issues. --- Generated by Claude Code Patch Reviewer