summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/probe-event.c
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2009-12-09 20:26:18 +0100
committerIngo Molnar <mingo@elte.hu>2009-12-10 08:30:26 +0100
commit5660ce34241ab204bf78fbcaa5e09318c2748d37 (patch)
treee1b8529e702fafd53e0097b5250edb578a23b396 /tools/perf/util/probe-event.c
parentperf_event: Fix perf_swevent_hrtimer() variable initialization (diff)
downloadlinux-5660ce34241ab204bf78fbcaa5e09318c2748d37.tar.xz
linux-5660ce34241ab204bf78fbcaa5e09318c2748d37.zip
perf tools: Correct size given to memset
Memset should be given the size of the structure, not the size of the pointer. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ type T; T *x; expression E; @@ memset(x, E, sizeof( + * x)) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <Pine.LNX.4.64.0912092026000.1870@ask.diku.dk> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/probe-event.c')
-rw-r--r--tools/perf/util/probe-event.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 9480d9941cc0..d14a4585bcaf 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -376,7 +376,7 @@ static void clear_probe_point(struct probe_point *pp)
free(pp->args);
for (i = 0; i < pp->found; i++)
free(pp->probes[i]);
- memset(pp, 0, sizeof(pp));
+ memset(pp, 0, sizeof(*pp));
}
/* Show an event */