public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] markers: fix unchecked format
@ 2008-10-08  2:23 Lai Jiangshan
  2008-10-08  4:05 ` Mathieu Desnoyers
  0 siblings, 1 reply; 5+ messages in thread
From: Lai Jiangshan @ 2008-10-08  2:23 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Mathieu Desnoyers, Linux Kernel Mailing List


when the second, third... probe is registered, its format is
not checked, this patch fix it.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/kernel/marker.c b/kernel/marker.c
index 4440a09..1196a6b 100644
--- a/kernel/marker.c
+++ b/kernel/marker.c
@@ -651,11 +651,17 @@ int marker_probe_register(const char *name, const char *format,
 	entry = get_marker(name);
 	if (!entry) {
 		entry = add_marker(name, format);
-		if (IS_ERR(entry)) {
+		if (IS_ERR(entry))
 			ret = PTR_ERR(entry);
-			goto end;
-		}
+	} else if (format) {
+		if (!entry->format)
+			ret = marker_set_format(&entry, format);
+		else if (strcmp(entry->format, format))
+			ret = -EPERM;
 	}
+	if (ret)
+		goto end;
+
 	/*
 	 * If we detect that a call_rcu is pending for this marker,
 	 * make sure it's executed now.



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-10-09 14:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-08  2:23 [PATCH] markers: fix unchecked format Lai Jiangshan
2008-10-08  4:05 ` Mathieu Desnoyers
2008-10-08  5:04   ` Lai Jiangshan
2008-10-09 13:46     ` Mathieu Desnoyers
2008-10-09 14:05       ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox