public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Frederic Weisbecker <fweisbec@gmail.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	fweisbec@gmail.com, rostedt@goodmis.org, tglx@linutronix.de,
	prasad@linux.vnet.ibm.com, mingo@elte.hu
Subject: [tip:perf/core] ksym_tracer: Fix breakpoint removal after modification
Date: Thu, 26 Nov 2009 08:44:42 GMT	[thread overview]
Message-ID: <tip-d99be40aff88722ab03ee295e4f6c13a4cca9a3d@git.kernel.org> (raw)
In-Reply-To: <1259210142-5714-1-git-send-regression-fweisbec@gmail.com>

Commit-ID:  d99be40aff88722ab03ee295e4f6c13a4cca9a3d
Gitweb:     http://git.kernel.org/tip/d99be40aff88722ab03ee295e4f6c13a4cca9a3d
Author:     Frederic Weisbecker <fweisbec@gmail.com>
AuthorDate: Thu, 26 Nov 2009 05:35:40 +0100
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 26 Nov 2009 09:29:20 +0100

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>
---
 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 11935b5..9f040e4 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) */

      parent reply	other threads:[~2009-11-26  8:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-26  4:35 [PATCH 1/3] ksym_tracer: Fix breakpoint removal after modification Frederic Weisbecker
2009-11-26  4:35 ` [PATCH 2/3] hw-breakpoints: Improve in-kernel event creation error granularity Frederic Weisbecker
2009-11-26  8:44   ` [tip:perf/core] " tip-bot for Frederic Weisbecker
2009-11-26  4:35 ` [PATCH 3/3] hw-breakpoints: Simplify error handling in breakpoint creation requests Frederic Weisbecker
2009-11-26  8:45   ` [tip:perf/core] " tip-bot for Frederic Weisbecker
2009-11-26  5:04 ` [PATCH 4/3] x86/hw-breakpoints: Don't lose GE flag while disabling a breakpoint Frederic Weisbecker
2009-11-26  8:45   ` [tip:perf/core] " tip-bot for Frederic Weisbecker
2009-11-26  8:44 ` tip-bot for Frederic Weisbecker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-d99be40aff88722ab03ee295e4f6c13a4cca9a3d@git.kernel.org \
    --to=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=prasad@linux.vnet.ibm.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox