[PATCH] trace: fix a wrong usage of simple_read_from_buffer()

From: Amerigo Wang
Date: Tue May 12 2009 - 03:12:39 EST



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@xxxxxxxxxx>
Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>

---
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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/