diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2009-11-25 23:35:40 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-11-26 03:29:20 -0500 |
commit | d99be40aff88722ab03ee295e4f6c13a4cca9a3d (patch) | |
tree | 53b362f02793d2cf1ca78f1d60ad26c1c5a1450e /kernel | |
parent | 470dda7417f284b9cfc96560b2acd98df63798a2 (diff) |
ksym_tracer: Fix breakpoint removal after modification
The error path of a breakpoint modification is broken in
the ksym tracer. A modified breakpoint hlist node is immediately
released after its removal. Also we leak a breakpoint in this
case.
Fix the path.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Prasad <prasad@linux.vnet.ibm.com>
LKML-Reference: <1259210142-5714-1-git-send-regression-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/trace_ksym.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/kernel/trace/trace_ksym.c b/kernel/trace/trace_ksym.c index 11935b53a6cb..9f040e42f516 100644 --- a/kernel/trace/trace_ksym.c +++ b/kernel/trace/trace_ksym.c | |||
@@ -339,14 +339,20 @@ static ssize_t ksym_trace_filter_write(struct file *file, | |||
339 | ksym_hbp_handler, true); | 339 | ksym_hbp_handler, true); |
340 | if (IS_ERR(entry->ksym_hbp)) | 340 | if (IS_ERR(entry->ksym_hbp)) |
341 | entry->ksym_hbp = NULL; | 341 | entry->ksym_hbp = NULL; |
342 | if (!entry->ksym_hbp) | 342 | |
343 | /* modified without problem */ | ||
344 | if (entry->ksym_hbp) { | ||
345 | ret = 0; | ||
343 | goto out; | 346 | goto out; |
347 | } | ||
348 | } else { | ||
349 | ret = 0; | ||
344 | } | 350 | } |
351 | /* Error or "symbol:---" case: drop it */ | ||
345 | ksym_filter_entry_count--; | 352 | ksym_filter_entry_count--; |
346 | hlist_del_rcu(&(entry->ksym_hlist)); | 353 | hlist_del_rcu(&(entry->ksym_hlist)); |
347 | synchronize_rcu(); | 354 | synchronize_rcu(); |
348 | kfree(entry); | 355 | kfree(entry); |
349 | ret = 0; | ||
350 | goto out; | 356 | goto out; |
351 | } else { | 357 | } else { |
352 | /* Check for malformed request: (4) */ | 358 | /* Check for malformed request: (4) */ |