lkml.org 
[lkml]   [2013]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: lockdep: testing '0' where '\0' intended?
On Sat, Oct 12, 2013 at 01:06:03AM +0200, Roel Kluin wrote:
> 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 <roel.kluin@gmail.com>
> ---
> diff --git a/kernel/lockdep_proc.c b/kernel/lockdep_proc.c
> index b2c71c5..71b3aba 100644
> --- a/kernel/lockdep_proc.c
> +++ b/kernel/lockdep_proc.c
> @@ -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.


\
 
 \ /
  Last update: 2013-10-12 17:01    [W:0.157 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site