diff options
author | Jaswinder Singh Rajput <jaswinder@kernel.org> | 2009-03-18 12:48:56 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-18 13:54:39 -0400 |
commit | 09933a108e6730a464a1ab676c9decc11aee0edc (patch) | |
tree | 1233d15bd2e1e0e4fbfa4144a878f553a3b04a35 /kernel/tracepoint.c | |
parent | 490362003457f8d387f6f6e73e3a7efbf56c3314 (diff) |
tracing: fix oops in tracepoint_update_probe_range()
Change this crash:
BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [<ffffffff8107d4de>] tracepoint_update_probe_range+0x1f/0x9b
PGD 13d5fb067 PUD 13d688067 PMD 0
Oops: 0000 [#1] SMP
To a more debuggable WARN_ONCE().
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <1237394936.3132.1.camel@localhost.localdomain>
[ moved the check outside the lock and added a WARN_ON(). ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/tracepoint.c')
-rw-r--r-- | kernel/tracepoint.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c index 79602740bbb5..adf28734fe2d 100644 --- a/kernel/tracepoint.c +++ b/kernel/tracepoint.c | |||
@@ -272,12 +272,17 @@ static void disable_tracepoint(struct tracepoint *elem) | |||
272 | * | 272 | * |
273 | * Updates the probe callback corresponding to a range of tracepoints. | 273 | * Updates the probe callback corresponding to a range of tracepoints. |
274 | */ | 274 | */ |
275 | void tracepoint_update_probe_range(struct tracepoint *begin, | 275 | void |
276 | struct tracepoint *end) | 276 | tracepoint_update_probe_range(struct tracepoint *begin, struct tracepoint *end) |
277 | { | 277 | { |
278 | struct tracepoint *iter; | 278 | struct tracepoint *iter; |
279 | struct tracepoint_entry *mark_entry; | 279 | struct tracepoint_entry *mark_entry; |
280 | 280 | ||
281 | if (!begin) { | ||
282 | WARN_ON_ONCE(1); | ||
283 | return; | ||
284 | } | ||
285 | |||
281 | mutex_lock(&tracepoints_mutex); | 286 | mutex_lock(&tracepoints_mutex); |
282 | for (iter = begin; iter < end; iter++) { | 287 | for (iter = begin; iter < end; iter++) { |
283 | mark_entry = get_tracepoint(iter->name); | 288 | mark_entry = get_tracepoint(iter->name); |