From 6143114460e5125621747cde2f712fed445b9a15 Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Mon, 4 Nov 2024 11:28:21 -0500 Subject: Fix a critical regression in 71be6bb5 causing multiple API failures 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. --- device_info_procfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, if ((read = nvdebug_readl(g, (uintptr_t)pde_data(file_inode(f)))) == -1) return -EOPNOTSUPP; // 32 bit register will always take less than 16 characters to print - chars_written = scnprintf(out, 16, "%#0x\n", nvdebug_readl(g, read)); + chars_written = scnprintf(out, 16, "%#0x\n", read); if (copy_to_user(buf, out, chars_written)) printk(KERN_WARNING "[nvdebug] %s: Unable to copy all data for %s\n", __func__, file_dentry(f)->d_name.name); *off += chars_written; -- cgit v1.2.2