Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933088AbbLCNGg (ORCPT ); Thu, 3 Dec 2015 08:06:36 -0500 Received: from szxga01-in.huawei.com ([58.251.152.64]:62452 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932332AbbLCNGf (ORCPT ); Thu, 3 Dec 2015 08:06:35 -0500 From: Wang Nan To: , CC: , , , Wang Nan , Arnaldo Carvalho de Melo , Namhyung Kim Subject: [PATCH] perf machine: Pass correct string to dso__adjust_kmod_long_name Date: Thu, 3 Dec 2015 13:06:02 +0000 Message-ID: <1449147962-16074-1-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.3.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.107.193.248] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A0B0206.56603E4A.00BD,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 0cf841954dcb1212fe67adfa2c19f618 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1335 Lines: 36 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 Cc: Arnaldo Carvalho de Melo Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Zefan Li 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/