Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1284970

[PATCH resend] perf machine: Pass correct string to dso__adjust_kmod_long_name

From Wang Nan <wangnan0@huawei.com>
Newsgroups linux.kernel
Subject [PATCH resend] perf machine: Pass correct string to dso__adjust_kmod_long_name
Date 2015-12-07 03:40 +0100
Message-ID <qCTSx-6PC-9@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH resend] perf machine: Pass correct string to dso__adjust_kmod_long_name Wang Nan <wangnan0@huawei.com> - 2015-12-07 03:40 +0100
  RE: [PATCH resend] perf machine: Pass correct string to  dso__adjust_kmod_long_name 平松雅巳 / HIRAMATU,MASAMI   <masami.hiramatsu.pt@hitachi.com> - 2015-12-07 04:40 +0100
  [tip:perf/core] perf machine:   Pass correct string to dso__adjust_kmod_long_name tip-bot for Wang Nan <tipbot@zytor.com> - 2015-12-08 05:40 +0100

csiph-web