From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: rust: drm: fix unsound initialization in drm::Device::new Date: Tue, 05 May 2026 09:29:46 +1000 Message-ID: In-Reply-To: <20260501-fix-drm-1-v2-1-5c4f681837bc@nvidia.com> References: <20260501-fix-drm-1-v2-1-5c4f681837bc@nvidia.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: rust: drm: fix unsound initialization in drm::Device::new Author: Eliot Courtney Patches: 3 Reviewed: 2026-05-05T09:29:46.588748 --- This is a single-patch series fixing a real **soundness bug** in the Rust D= RM device initialization path. The bug is: if `data.__pinned_init()` fails,= the error path calls `drm_dev_put()`, which drops the refcount to zero, tr= iggering `Self::release()`, which calls `drop_in_place()` on a `Device` = whose `data` field was never initialized =E2=80=94 undefined behavior. The fix is well-designed: use a temporary vtable with `release: None` durin= g the initialization window, so that if init fails, `drm_dev_put()` skips t= he release callback and never drops uninitialized memory. After successful = init, install the real vtable with the `const { &Self::VTABLE }` trick to g= uarantee a `'static` reference. The approach is sound and the implementatio= n is correct. **Recommendation: Accept.** One minor documentation nit below. --- --- Generated by Claude Code Patch Reviewer