Skip to content

Commit 174610c

Browse files
author
Roni Nevalainen
committed
Initialize field owner in file_operations
Initialized the field `owner` in struct `file_operations`. It's used to increment the module ref count when a file is opened, to prevent the module from being unloaded. Fixes the issue #214 Signed-off-by: Roni Nevalainen <kitten@kittenz.dev>
1 parent d4bf48b commit 174610c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rust/kernel/file_operations.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ impl<A: FileOpenAdapter, T: FileOpener<A::Arg>> FileOperationsVtable<A, T> {
315315
None
316316
},
317317
mmap_supported_flags: 0,
318-
owner: ptr::null_mut(),
318+
owner: crate::ThisModule as *mut bindings::module,
319319
poll: if T::TO_USE.poll {
320320
Some(poll_callback::<T>)
321321
} else {

0 commit comments

Comments
 (0)