mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] perf machine: Pass correct string to dso__adjust_kmod_long_name
@ 2015-12-03 13:06 Wang Nan
  0 siblings, 0 replies; only message in thread
From: Wang Nan @ 2015-12-03 13:06 UTC (permalink / raw)
  To: acme, masami.hiramatsu.pt
  Cc: lizefan, pi3orama, linux-kernel, Wang Nan,
	Arnaldo Carvalho de Melo, Namhyung Kim

There's a mistake in dso__adjust_kmod_long_name() that, it use strdup()
to dup the new long_name of a dso, but passes the original string
to dso__set_long_name(). Which causes random crash during cleanup.

Fixes: c03d5184f0e9("perf machine: Adjust dso->long_name for offline module")
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
---
 tools/perf/util/machine.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 95a7f60..bfc289c 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -576,7 +576,7 @@ static void dso__adjust_kmod_long_name(struct dso *dso, const char *filename)
 	if (!dup_filename)
 		return;
 
-	dso__set_long_name(dso, filename, true);
+	dso__set_long_name(dso, dup_filename, true);
 }
 
 struct map *machine__findnew_module_map(struct machine *machine, u64 start,
-- 
1.8.3.4


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-12-03 13:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-03 13:06 [PATCH] perf machine: Pass correct string to dso__adjust_kmod_long_name Wang Nan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®