arm64: kvm: ptdump: Initialize .owner fields of kvm_*_operations
PATCH 1/1 arm64: kvm: ptdump: Initialize .owner fields of kvm_*_operations
Initialize .owner fields of kvm_ptdump_guest_fops, kvm_pgtable_range_fops and kvm_pgtable_levels_fops to THIS_MODULE in order to prevent unloading the module while these operations are still in use.
Signed-off-by Salah Triki <[email protected]>
--- arch/arm64/kvm/ptdump.c | 3 +++ 1 file changed, 3 insertions(+)
arch/arm64/kvm/ptdump.c +3 -0
@@ -185,6 +185,7 @@ static int kvm_ptdump_guest_close(struct inode *m, struct file *file) }static const struct file_operations kvm_ptdump_guest_fops = { + .owner =THIS_MODULE , .open = kvm_ptdump_guest_open, .read = seq_read, .llseek = seq_lseek,
@@ -244,6 +245,7 @@ static int kvm_pgtable_debugfs_close(struct inode *m, struct file *file) }static const struct file_operations kvm_pgtable_range_fops = { + .owner =THIS_MODULE , .open = kvm_pgtable_range_open, .read = seq_read, .llseek = seq_lseek,
@@ -251,6 +253,7 @@ static const struct file_operations kvm_pgtable_range_fops = { };static const struct file_operations kvm_pgtable_levels_fops = { + .owner =THIS_MODULE , .open = kvm_pgtable_levels_open, .read = seq_read, .llseek = seq_lseek,
Signature · 1 line
2.34.1
Marc Zyngier
maintainerQuoted 5 lines · Salah Triki
Initialize .owner fields of
kvm_ptdump_guest_fops,kvm_pgtable_range_fopsandkvm_pgtable_levels_fopstoTHIS_MODULEin order to prevent unloading the module while these operations are still in use.
Colour me curious, but what module are we talking about here?
M.
Signature · 1 line
Without deviation from the norm, progress is not possible.