Set the miscdevice fops owner field from the driver module pointer via the `this_module::<T::OwnerModule>()` helper, instead of defaulting to null.
Showing the changes to rust/kernel (1 of 1 file). Show all
Unified · Split
| @@ -24,12 +24,13 @@ use crate::{ · 23 unmodified lines | ||
| 24 | 24 | IovIterSource, // |
| 25 | 25 | }, |
| 26 | 26 | mm::virt::VmaNew, |
| 27 | + module::this_module, | |
| 27 | 28 | prelude::*, |
| 28 | 29 | seq_file::SeqFile, |
| 29 | 30 | types::{ |
| 30 | 31 | ForeignOwnable, |
| 31 | 32 | Opaque, // |
| 32 | − }, | |
| 33 | + }, // | |
| 33 | 34 | }; |
| 34 | 35 | use core::marker::PhantomData; |
| 35 | 36 | |
| @@ -430,6 +431,7 @@ impl<T: MiscDevice> MiscdeviceVTable<T> { · 394 unmodified lines | ||
| 430 | 431 | } else { |
| 431 | 432 | None |
| 432 | 433 | }, |
| 434 | + owner: this_module::<T::OwnerModule>().as_ptr(), | |
| 433 | 435 | ..pin_init::zeroed() |
| 434 | 436 | }; |
| 435 | 437 | |