Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp886999yba; Thu, 18 Apr 2019 11:13:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqydopuGI0KjWDg8hbTKzqFJguB9pxOh04b3OeKG1nWyHOwdCSYIL4G2vfbkITGjhcRXR9L1 X-Received: by 2002:a17:902:8349:: with SMTP id z9mr6714754pln.144.1555611192422; Thu, 18 Apr 2019 11:13:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555611192; cv=none; d=google.com; s=arc-20160816; b=FyL17usYNWkMT+Z6ZEyqtm2KdAccvZRIg+WaxtH1PhlHgp9fQqR04bd9d27linpPqh +ATPhRVZ9P1OlxrQVeTzkM6376eopgYwH5ruKLaAjhEeM8sRmNVir7Rtt7xWt2OyYKXn vldHZ5FQW22+nr1W3Lus6vc918fP9s864L2LgSsrOl4ZaHgTqeulY/bScwU8brCWk9ix IAbKoWum3IsbavXuckEudqM298HrIBPFB0nu3sU+9fUnraMOH1nC882BtlisJGqNwX32 xsTaca0wLSXTh7PFalmw6TxGgJdOVs32xwsTcRXvCxVnA35no1QqxXp30nuSVmhGa9lO yX7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uccod4a6p4/9YFfs1hU9X6VbDZ9zVLaMun1K3s7cqAU=; b=g5N7CER/zjZ5HAp7wmbYdoeh8h4xOzJUJnKBiptkwGzN+0yNk67GhlWpoAYHTC8FJM 3ZmDUmFJtDkE/EFjbtq1j7krEEKm5dc2FMQMzO0nRjjj5sslV3Fa4WXPkgWnqd/3VNfO zOf2z0FchwwTBy9WzVt3ALzlB654ucneKTjo+bfJP53zrd4PtU1G2t2BVrKJY1imS3/z P3p/EP+lzGbJD8odvTzPd8+rnq0ayIdHmp2jfU3xDs8Xg+tJwTBawETMg8VRA1nofhof aZtEDiOZJvxCwTVT4j/4zaJTkB9npzI+wTBUMG2P3xNHrMXQxN2mgZGdRTswHO5LNxew 2UgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tfgoo1qK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b91si2775147plb.426.2019.04.18.11.12.57; Thu, 18 Apr 2019 11:13:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tfgoo1qK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391902AbfDRSLO (ORCPT + 99 others); Thu, 18 Apr 2019 14:11:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:43332 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391893AbfDRSLM (ORCPT ); Thu, 18 Apr 2019 14:11:12 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C122C218CD; Thu, 18 Apr 2019 18:11:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555611071; bh=vE9BdeZyuJnjXY3pmuxyXYnKQvG+OyWuX7A+e4ijt9A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tfgoo1qKxt2vM0AWzWD/HJ5XG9qYfAaI9FqIxAoaoFrsATTsSIGJ/vTqP4OyJb1FU rqFv1EZrMKtlIxqeaS8oVb8MaONFDzWCeDcTV6cacUBC/gXZcjDVTo/8bD1kYQqI7t zVjBYK/HMsx55z/d3QAxB2ODiiEkAFqu0kjdZo0A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Changbin Du , Jiri Olsa , Alexei Starovoitov , Daniel Borkmann , Namhyung Kim , Peter Zijlstra , "Steven Rostedt (VMware)" , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 5.0 48/93] perf tests: Fix a memory leak in test__perf_evsel__tp_sched_test() Date: Thu, 18 Apr 2019 19:57:26 +0200 Message-Id: <20190418160442.507531486@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160436.781762249@linuxfoundation.org> References: <20190418160436.781762249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit d982b33133284fa7efa0e52ae06b88f9be3ea764 ] ================================================================= ==20875==ERROR: LeakSanitizer: detected memory leaks Direct leak of 1160 byte(s) in 1 object(s) allocated from: #0 0x7f1b6fc84138 in calloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xee138) #1 0x55bd50005599 in zalloc util/util.h:23 #2 0x55bd500068f5 in perf_evsel__newtp_idx util/evsel.c:327 #3 0x55bd4ff810fc in perf_evsel__newtp /home/work/linux/tools/perf/util/evsel.h:216 #4 0x55bd4ff81608 in test__perf_evsel__tp_sched_test tests/evsel-tp-sched.c:69 #5 0x55bd4ff528e6 in run_test tests/builtin-test.c:358 #6 0x55bd4ff52baf in test_and_print tests/builtin-test.c:388 #7 0x55bd4ff543fe in __cmd_test tests/builtin-test.c:583 #8 0x55bd4ff5572f in cmd_test tests/builtin-test.c:722 #9 0x55bd4ffc4087 in run_builtin /home/changbin/work/linux/tools/perf/perf.c:302 #10 0x55bd4ffc45c6 in handle_internal_command /home/changbin/work/linux/tools/perf/perf.c:354 #11 0x55bd4ffc49ca in run_argv /home/changbin/work/linux/tools/perf/perf.c:398 #12 0x55bd4ffc5138 in main /home/changbin/work/linux/tools/perf/perf.c:520 #13 0x7f1b6e34809a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a) Indirect leak of 19 byte(s) in 1 object(s) allocated from: #0 0x7f1b6fc83f30 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xedf30) #1 0x7f1b6e3ac30f in vasprintf (/lib/x86_64-linux-gnu/libc.so.6+0x8830f) Signed-off-by: Changbin Du Reviewed-by: Jiri Olsa Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Steven Rostedt (VMware) Fixes: 6a6cd11d4e57 ("perf test: Add test for the sched tracepoint format fields") Link: http://lkml.kernel.org/r/20190316080556.3075-17-changbin.du@gmail.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/tests/evsel-tp-sched.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/tests/evsel-tp-sched.c b/tools/perf/tests/evsel-tp-sched.c index ea7acf403727..71f60c0f9faa 100644 --- a/tools/perf/tests/evsel-tp-sched.c +++ b/tools/perf/tests/evsel-tp-sched.c @@ -85,5 +85,6 @@ int test__perf_evsel__tp_sched_test(struct test *test __maybe_unused, int subtes if (perf_evsel__test_field(evsel, "target_cpu", 4, true)) ret = -1; + perf_evsel__delete(evsel); return ret; } -- 2.19.1