From: Juha Leppanen Date: Mon, 7 Dec 2009 17:00:40 +0000 (-0500) Subject: perf probe: Fix strtailcmp() to compare s1and s2[0] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d56728b8d7fb3e1e5e5f97b88fdf6b43a35b4f5e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git perf probe: Fix strtailcmp() to compare s1and s2[0] Fix strtailcmp() to compare s1[0] and s2[0]. strtailcmp() returns 0 if "a" and "b" or "a" and "ab", it's a wrong behavior. This patch fixes it. Signed-off-by: "Juha Leppanen" Acked-by: Masami Hiramatsu Cc: systemtap Cc: DLE Cc: Juha Leppanen Cc: Frederic Weisbecker LKML-Reference: <20091207170040.19230.37464.stgit@dhcp-100-2-132.bos.redhat.com> Signed-off-by: Ingo Molnar --- diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index 293cdfc1b8ca..4585f1d86792 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c @@ -106,7 +106,7 @@ static int strtailcmp(const char *s1, const char *s2) { int i1 = strlen(s1); int i2 = strlen(s2); - while (--i1 > 0 && --i2 > 0) { + while (--i1 >= 0 && --i2 >= 0) { if (s1[i1] != s2[i2]) return s1[i1] - s2[i2]; }