summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2012-05-24 09:06:24 +0200
committerIngo Molnar <mingo@kernel.org>2012-05-24 09:06:24 +0200
commit9ba0541453b3a57797701b9fbc0fd8d0be173050 (patch)
tree29cc15e3d9b05d78f8adb8516baf6c1a3d7626a9 /kernel
parentf9369910a6225b8d4892c3f20ae740a711cd5ace (diff)
parent6a31e1f135d1abfb5137697f889c8cd5d72eb522 (diff)
Merge branch 'tip/perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace into perf/urgent
Pull an ftrace ring-buffer fix from Steve Rostedt: * fix kernel crash when changing the size of the ring-buffer on boxes where possible_cpus != online_cpus. Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/ring_buffer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 6420cda6233..1d0f6a8a0e5 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -1486,6 +1486,11 @@ int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size,
if (!buffer)
return size;
+ /* Make sure the requested buffer exists */
+ if (cpu_id != RING_BUFFER_ALL_CPUS &&
+ !cpumask_test_cpu(cpu_id, buffer->cpumask))
+ return size;
+
size = DIV_ROUND_UP(size, BUF_PAGE_SIZE);
size *= BUF_PAGE_SIZE;