aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Bakita <jbakita@cs.unc.edu>2024-11-04 11:28:21 -0500
committerJoshua Bakita <jbakita@cs.unc.edu>2024-11-04 11:28:21 -0500
commit6143114460e5125621747cde2f712fed445b9a15 (patch)
tree14465bb256527e958766140bcc6811dd597cfe99
parentf347fde22f1297e4f022600d201780d5ead78114 (diff)
Fix a critical regression in 71be6bb5 causing multiple API failuresHEADmasterjbakita-wip
Instead of printing the read in `nvdebug_reg32_read()`, another read was being performed, using the first read value as the register offset! This is a mistaken incomplete removal of the old pre-error- -handling logic in 71be6bb5. This caused any APIs using this function to not work by returning bizzare or incorrect values, or crashing the system on Jetson boards.
-rw-r--r--device_info_procfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/device_info_procfs.c b/device_info_procfs.c
index 0229eec..4e4ab03 100644
--- a/device_info_procfs.c
+++ b/device_info_procfs.c
@@ -20,7 +20,7 @@ static ssize_t nvdebug_reg32_read(struct file *f, char __user *buf, size_t size,
20 if ((read = nvdebug_readl(g, (uintptr_t)pde_data(file_inode(f)))) == -1) 20 if ((read = nvdebug_readl(g, (uintptr_t)pde_data(file_inode(f)))) == -1)
21 return -EOPNOTSUPP; 21 return -EOPNOTSUPP;
22 // 32 bit register will always take less than 16 characters to print 22 // 32 bit register will always take less than 16 characters to print
23 chars_written = scnprintf(out, 16, "%#0x\n", nvdebug_readl(g, read)); 23 chars_written = scnprintf(out, 16, "%#0x\n", read);
24 if (copy_to_user(buf, out, chars_written)) 24 if (copy_to_user(buf, out, chars_written))
25 printk(KERN_WARNING "[nvdebug] %s: Unable to copy all data for %s\n", __func__, file_dentry(f)->d_name.name); 25 printk(KERN_WARNING "[nvdebug] %s: Unable to copy all data for %s\n", __func__, file_dentry(f)->d_name.name);
26 *off += chars_written; 26 *off += chars_written;