diff options
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r-- | kernel/trace/ftrace.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 7968762c8167..1e6640f80454 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -1690,7 +1690,7 @@ ftrace_regex_lseek(struct file *file, loff_t offset, int origin) | |||
1690 | static int ftrace_match(char *str, char *regex, int len, int type) | 1690 | static int ftrace_match(char *str, char *regex, int len, int type) |
1691 | { | 1691 | { |
1692 | int matched = 0; | 1692 | int matched = 0; |
1693 | char *ptr; | 1693 | int slen; |
1694 | 1694 | ||
1695 | switch (type) { | 1695 | switch (type) { |
1696 | case MATCH_FULL: | 1696 | case MATCH_FULL: |
@@ -1706,8 +1706,8 @@ static int ftrace_match(char *str, char *regex, int len, int type) | |||
1706 | matched = 1; | 1706 | matched = 1; |
1707 | break; | 1707 | break; |
1708 | case MATCH_END_ONLY: | 1708 | case MATCH_END_ONLY: |
1709 | ptr = strstr(str, regex); | 1709 | slen = strlen(str); |
1710 | if (ptr && (ptr[len] == 0)) | 1710 | if (slen >= len && memcmp(str + slen - len, regex, len) == 0) |
1711 | matched = 1; | 1711 | matched = 1; |
1712 | break; | 1712 | break; |
1713 | } | 1713 | } |