mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roel Kluin <roel.kluin@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: lockdep: testing '0' where '\0' intended?
Date: Sat, 12 Oct 2013 01:06:03 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.02.1310120043280.11060@Z> (raw)

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')
 			return count;
 
 		list_for_each_entry(class, &all_lock_classes, lock_entry)


             reply	other threads:[~2013-10-11 23:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-11 23:06 Roel Kluin [this message]
2013-10-12 14:40 ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.02.1310120043280.11060@Z \
    --to=roel.kluin@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome