aboutsummaryrefslogtreecommitdiffstats
path: root/nvdebug_entry.c
diff options
context:
space:
mode:
authorJoshua Bakita <bakitajoshua@gmail.com>2023-07-03 12:44:32 -0400
committerJoshua Bakita <bakitajoshua@gmail.com>2023-07-03 12:44:32 -0400
commit073e8978334a07e0053ee08310743ddf3046d7d2 (patch)
treef73583c3ea3fd3c9416313736a697254bc866fed /nvdebug_entry.c
parenta3fe3788535dd099d15e0ddca455be58e1d63156 (diff)
Fix addressing, zero-init, and compatibility bugs in a3fe378
- Including missing dereference to finish getting the address of the control register range - Add zero-initialization to the proc_ops structure in copat_ops to insure that all intentionally unset fields remain unset - Set .llseek in all the file_operations structures, as recent kernels require this to be explictly set
Diffstat (limited to 'nvdebug_entry.c')
-rw-r--r--nvdebug_entry.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/nvdebug_entry.c b/nvdebug_entry.c
index 60fb7af..8e8266c 100644
--- a/nvdebug_entry.c
+++ b/nvdebug_entry.c
@@ -35,7 +35,7 @@ unsigned int g_nvdebug_devices = 0;
35#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) 35#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
36// This rewrites the struct to the proc_ops layout on newer kernels 36// This rewrites the struct to the proc_ops layout on newer kernels
37const struct proc_ops* compat_ops(const struct file_operations* ops) { 37const struct proc_ops* compat_ops(const struct file_operations* ops) {
38 struct proc_ops new_ops; 38 struct proc_ops new_ops = {};
39 new_ops.proc_open = ops->open; 39 new_ops.proc_open = ops->open;
40 new_ops.proc_read = ops->read; 40 new_ops.proc_read = ops->read;
41 new_ops.proc_write = ops->write; 41 new_ops.proc_write = ops->write;