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 resource leaks Date: Fri, 27 Feb 2026 13:15:06 +1000 Message-ID: In-Reply-To: <20260225145154.14168-1-ethantidmore06@gmail.com> References: <20260225145154.14168-1-ethantidmore06@gmail.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Overall Series Review Subject: drm/amdgpu: Fix resource leaks Author: Ethan Tidmore Patches: 1 Reviewed: 2026-02-27T13:15:06.912896 --- This is a single patch (v2) that converts `ioremap()`/`iounmap()` of `adev-= >rmmio` to `devm_ioremap()` to fix resource leaks on error paths in `amdgpu= _device_init()`. While the Smatch warning about the error-path leaks is leg= itimate, this fix is **incorrect and introduces a use-after-free bug** that= is worse than the original leak. The fundamental problem is a **lifetime mismatch**: `devm_ioremap()` ties t= he resource lifetime to the PCI `struct device`, but `adev->rmmio` is acces= sed from the DRM device `.release` callback (`amdgpu_driver_release_kms` = =E2=86=92 `amdgpu_device_fini_sw`), which can run **long after** the PCI dr= iver has unbound and devm resources have been freed. **NAK** =E2=80=94 this needs a different approach. --- --- Generated by Claude Code Patch Reviewer