projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
41aad2a
)
perf probe: Check if *ptr2 is zero and not ptr2
author
Colin Ian King
<
[email protected]
>
Mon, 3 Oct 2016 10:34:31 +0000
(11:34 +0100)
committer
Arnaldo Carvalho de Melo
<
[email protected]
>
Mon, 3 Oct 2016 14:24:12 +0000
(11:24 -0300)
Static anaylsis with cppcheck[1] detected an incorrect comparison:
[tools/perf/util/probe-event.c:216]: (warning) Char literal compared
with pointer 'ptr2'. Did you intend to dereference it?
Dereference ptr2 for the comparison to fix this.
1: https://sourceforge.net/p/cppcheck/wiki/Home/
Signed-off-by: Colin King <
[email protected]
>
Cc: Alexander Shishkin <
[email protected]
>
Cc: Masami Hiramatsu <
[email protected]
>
Cc: Peter Zijlstra <
[email protected]
>
Cc: Ravi Bangoria <
[email protected]
>
Cc: Wang Nan <
[email protected]
>
Fixes: 35726d3a4ca9 ("perf probe: Fix to cut off incompatible chars from group name")
Link:
http://lkml.kernel.org/r/
[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <
[email protected]
>
tools/perf/util/probe-event.c
patch
|
blob
|
history
diff --git
a/tools/perf/util/probe-event.c
b/tools/perf/util/probe-event.c
index fcfbef07b92d8c9fbbce2adb35c4e43428818c30..d281ae2b54e8fef7b85574a8b799dc33c21e9e44 100644
(file)
--- a/
tools/perf/util/probe-event.c
+++ b/
tools/perf/util/probe-event.c
@@
-213,7
+213,7
@@
static int convert_exec_to_group(const char *exec, char **result)
goto out;
}
- for (ptr2 = ptr1; ptr2 != '\0'; ptr2++) {
+ for (ptr2 = ptr1;
*
ptr2 != '\0'; ptr2++) {
if (!isalnum(*ptr2) && *ptr2 != '_') {
*ptr2 = '\0';
break;