lockdep: testing '0' where '\0' intended?
Not entirely sure about the assembly part, but shouldn't it...
--------
Test for the nul character rather than the '0' (== 0x30), in the __get_user_unknown() case.
Signed-off-by Roel Kluin <[email protected]>
---
kernel/lockdep_proc.c +0 -0
@@ -632,7 +632,7 @@ static ssize_t lock_stat_write(struct file *file,
const char __user *buf,
if (get_user(c, buf))
return -EFAULT;
- if (c != '0')
+ if (c != '\0')
return count;
list_for_each_entry(class, &all_lock_classes, lock_entry)
Quoted 12 lines · Roel Kluin
Not entirely sure about the assembly part, but shouldn't it...
--------
Test for the nul character rather than the '0' (==0x30), in the__get_user_unknown()case.Signed-off-by Roel Kluin <[email protected]>---
kernel/lockdep_proc.c +0
-0
kernel/lockdep_proc.c static ssize_t lock_stat_write(struct file *file, · line 636
Quoted 6 lines
kernel/lockdep_proc.c +1
-1@@ -632,7 +632,7 @@ static ssize_t lock_stat_write(struct file *file, const char __user *buf, if (get_user(c, buf)) return -EFAULT; -if (c !='0' ) +if (c !='\0' )
No we really meant '0'. Its so that:
echo 0 > /proc/lock_stat
resets the stats.