diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2008-10-08 10:23:36 +0800 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-14 10:38:42 +0200 |
commit | 48043bcdf8f398d28e75ffed6ee85208d751f87f (patch) | |
tree | 7a4e4251ea400be7f4ff2955fe4a02cf62a208da /kernel | |
parent | 53c8c8fdfd2d2d515bdcb3d0f2a11d1f3f42ece1 (diff) | |
download | linux-48043bcdf8f398d28e75ffed6ee85208d751f87f.tar.gz linux-48043bcdf8f398d28e75ffed6ee85208d751f87f.tar.bz2 linux-48043bcdf8f398d28e75ffed6ee85208d751f87f.zip |
markers: fix unchecked format
when the second, third... probe is registered, its format is
not checked, this patch fixes it.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/marker.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/kernel/marker.c b/kernel/marker.c index 05a25776f71f..3b75d0e8b5a4 100644 --- a/kernel/marker.c +++ b/kernel/marker.c @@ -653,11 +653,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. |