Skip to content

Commit

Permalink
ksym_tracer: Fix breakpoint removal after modification
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Nov 26, 2009
1 parent 470dda7 commit d99be40
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions kernel/trace/trace_ksym.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,14 +339,20 @@ static ssize_t ksym_trace_filter_write(struct file *file,
ksym_hbp_handler, true);
if (IS_ERR(entry->ksym_hbp))
entry->ksym_hbp = NULL;
if (!entry->ksym_hbp)

/* modified without problem */
if (entry->ksym_hbp) {
ret = 0;
goto out;
}
} else {
ret = 0;
}
/* Error or "symbol:---" case: drop it */
ksym_filter_entry_count--;
hlist_del_rcu(&(entry->ksym_hlist));
synchronize_rcu();
kfree(entry);
ret = 0;
goto out;
} else {
/* Check for malformed request: (4) */
Expand Down

0 comments on commit d99be40

Please sign in to comment.