public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Amerigo Wang <amwang@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Steven Rostedt <rostedt@goodmis.org>,
	akpm@linux-foundation.org, Amerigo Wang <amwang@redhat.com>
Subject: [PATCH] trace: fix a wrong usage of simple_read_from_buffer()
Date: Tue, 12 May 2009 03:11:09 -0400	[thread overview]
Message-ID: <20090512071156.5664.17626.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20090512071148.5664.91161.sendpatchset@localhost.localdomain>


The last argument of simple_read_from_buffer() is the amount of the
available bytes in the buffer, not the size of the buffer.

Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>

---
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index a884c09..3a0bc70 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2125,7 +2125,7 @@ tracing_cpumask_read(struct file *filp, char __user *ubuf,
 		goto out_err;
 	}
 	len += sprintf(mask_str + len, "\n");
-	count = simple_read_from_buffer(ubuf, count, ppos, mask_str, NR_CPUS+1);
+	count = simple_read_from_buffer(ubuf, count, ppos, mask_str, len);
 
 out_err:
 	mutex_unlock(&tracing_cpumask_update_lock);

      reply	other threads:[~2009-05-12  7:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-12  7:11 [PATCH] trace: clean up some code Amerigo Wang
2009-05-12  7:11 ` Amerigo Wang [this message]

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=20090512071156.5664.17626.sendpatchset@localhost.localdomain \
    --to=amwang@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.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