Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 388c3aab authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Ingo Molnar
Browse files

perf probe: Init struct probe_point and set counter correctly



Clear struct probe_point before using it in
show_perf_probe_events(), and set pp->found counter correctly in
synthesize_perf_probe_point(). Without this initialization,
clear_probe_point() will free random addresses.

Signed-off-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
LKML-Reference: <20100218181652.26547.57790.stgit@dhcp-100-2-132.bos.redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 326264a0
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -272,6 +272,7 @@ int synthesize_perf_probe_point(struct probe_point *pp)
	int ret;

	pp->probes[0] = buf = zalloc(MAX_CMDLEN);
	pp->found = 1;
	if (!buf)
		die("Failed to allocate memory by zalloc.");
	if (pp->offset) {
@@ -294,6 +295,7 @@ int synthesize_perf_probe_point(struct probe_point *pp)
error:
		free(pp->probes[0]);
		pp->probes[0] = NULL;
		pp->found = 0;
	}
	return ret;
}
@@ -455,6 +457,7 @@ void show_perf_probe_events(void)
	struct strlist *rawlist;
	struct str_node *ent;

	memset(&pp, 0, sizeof(pp));
	fd = open_kprobe_events(O_RDONLY, 0);
	rawlist = get_trace_kprobe_event_rawlist(fd);
	close(fd);