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:
af2d828
)
perf tools: Correct size computation in tracepoint_id_to_path()
author
Julia Lawall
<
[email protected]
>
Sun, 6 Dec 2009 09:16:30 +0000
(10:16 +0100)
committer
Ingo Molnar
<
[email protected]
>
Sun, 6 Dec 2009 09:21:59 +0000
(10:21 +0100)
The size argument to zalloc should be the size of desired
structure, not the pointer to it.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@expression@
expression *x;
@@
x =
<+...
-sizeof(x)
+sizeof(*x)
...+>// </smpl>
Signed-off-by: Julia Lawall <
[email protected]
>
Cc: Peter Zijlstra <
[email protected]
>
Cc: Mike Galbraith <
[email protected]
>
Cc: Paul Mackerras <
[email protected]
>
Cc: Arnaldo Carvalho de Melo <
[email protected]
>
Cc: Frederic Weisbecker <
[email protected]
>
LKML-Reference: <Pine.LNX.4.64.
0912061016120
[email protected]
>
Signed-off-by: Ingo Molnar <
[email protected]
>
tools/perf/util/parse-events.c
patch
|
blob
|
history
diff --git
a/tools/perf/util/parse-events.c
b/tools/perf/util/parse-events.c
index 9e5dbd66d34d7aa95aad038d2168eaed5ef920b3..448a13b520150e16ce777d25a103dbcac5093254 100644
(file)
--- a/
tools/perf/util/parse-events.c
+++ b/
tools/perf/util/parse-events.c
@@
-197,7
+197,7
@@
struct tracepoint_path *tracepoint_id_to_path(u64 config)
if (id == config) {
closedir(evt_dir);
closedir(sys_dir);
- path = zalloc(sizeof(path));
+ path = zalloc(sizeof(
*
path));
path->system = malloc(MAX_EVENT_LENGTH);
if (!path->system) {
free(path);