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: set fops.owner from driver module pointer Date: Mon, 25 May 2026 20:45:43 +1000 Message-ID: In-Reply-To: <20260521-fix-fops-owner-v2-4-fd99079c5a04@linux.dev> References: <20260521-fix-fops-owner-v2-0-fd99079c5a04@linux.dev> <20260521-fix-fops-owner-v2-4-fd99079c5a04@linux.dev> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review This is one of the two actual bug-fix patches. Changes `create_fops()` to t= ake an `owner: *mut bindings::module` parameter: ```rust pub(super) const fn create_fops(owner: *mut bindings::module) -> bindings::= file_operations { ``` And the call site in `device.rs`: ```rust const GEM_FOPS: bindings::file_operations =3D drm::gem::create_fops(::THIS_MO= DULE.as_ptr()); ``` **Observations:** 1. This directly fixes the bug described in the cover letter. With `fops.ow= ner` set correctly, the kernel will `try_module_get()` on open and `module_= put()` on close, preventing `rmmod` while file descriptors are open. 2. The path `::THIS_MODULE.as_ptr()= ` correctly goes through the `Driver` trait's `ThisModule` associated type = (auto-injected by `#[vtable]`) to get the module pointer. Since `T: drm::Dr= iver` and `Driver` has `#[vtable]`, `T::ThisModule` is available and constr= ained to implement `ModuleMetadata`. 3. `create_fops()` is `pub(super)` and `const fn` =E2=80=94 taking a raw po= inter as parameter is fine in const context. **No issues found.** This is the critical fix for DRM. --- Generated by Claude Code Patch Reviewer