From: Frederic Weisbecker Date: Thu, 26 Nov 2009 04:35:40 +0000 (+0100) Subject: ksym_tracer: Fix breakpoint removal after modification X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d99be40aff88722ab03ee295e4f6c13a4cca9a3d;p=openwrt%2Fstaging%2Fblogic.git 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 Cc: Steven Rostedt Cc: Prasad LKML-Reference: <1259210142-5714-1-git-send-regression-fweisbec@gmail.com> Signed-off-by: Ingo Molnar --- 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, 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) */