[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1311602888-2389-1-git-send-email-bookjovi@gmail.com>
Date: Mon, 25 Jul 2011 22:08:08 +0800
From: bookjovi@...il.com
To: bookjovi@...il.com, acme@...stprotocols.net, mingo@...e.hu,
a.p.zijlstra@...llo.nl, paulus@...ba.org
Cc: linux-kernel@...r.kernel.org, root <root@...alhost.localdomain>
Subject: [PATCH] perf: fix coredump caused by introduce of probe module option
From: root <root@...alhost.localdomain>
perf will coredump if user don't give "-m" option in probe command,
this patch fix it.
[root@...alhost perf]# ./perf probe --add='PROBE'
Segmentation fault (core dumped)
Signed-off-by: Jovi Zhang <bookjovi@...il.com>
---
tools/perf/util/probe-event.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index b82d54f..1c7bfa5 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -1820,11 +1820,15 @@ static int convert_to_probe_trace_events(struct perf_probe_event *pev,
ret = -ENOMEM;
goto error;
}
- tev->point.module = strdup(module);
- if (tev->point.module == NULL) {
- ret = -ENOMEM;
- goto error;
+
+ if (module) {
+ tev->point.module = strdup(module);
+ if (tev->point.module == NULL) {
+ ret = -ENOMEM;
+ goto error;
+ }
}
+
tev->point.offset = pev->point.offset;
tev->point.retprobe = pev->point.retprobe;
tev->nargs = pev->nargs;
--
1.6.5.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists