Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp897676yba; Thu, 18 Apr 2019 11:24:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6rodKG/mHcUh6slAdRKdmJRwu+jo5rE3zPybO1GYVFlutvxUi8FacsCK6uc96OFfY9MEW X-Received: by 2002:a63:c112:: with SMTP id w18mr91112860pgf.200.1555611886062; Thu, 18 Apr 2019 11:24:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555611886; cv=none; d=google.com; s=arc-20160816; b=rLegc0qsAz9uzfHrdkBtLZEG5pxLhSfdFuALHuswHVk5179K+qGcHsRXjTtgFrhDG0 9+tRHrSK4pG5OFMGt4QAeruSLUIs7yKfiFK7Vr+U8NTkJUdim+kNO1L4xOVwleFVbavr ZvynuFr7qmNPVymGwkRZVgyUI7NDDI9KLpkhY0ZAG7EqRIc/nkY0X+sKPzY+X6gem0Ji 0KHfOQvUmT/VZV62A0hC9q9IzhOBj3oIyRlzqlLB7buM3DBV635lanMKXUbmitNDVW8L vetEADXZODx+eifo6z2awyHjCkgu/OI1Bd45WDre+Of+UYbFoFB63AH+cRcPTC97yZMt J9hA== 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=jsTJaKfy2i6wyniid8S+U82+7O7HTxy4sj5oWijqA8E=; b=G3+BGo5LRLF68M/SyvZuZn+DpJr12GMMkeDo7pNOxKpvQQYD2ZIgTibTpJYGlYz3d7 F2mjgqFKCQLTvU0R4da2GQDM674o+6g/E/Rz7PneBd1fNLtA1Kf7Vx/XSHYYAaz6HK2M dDmG8k8zVduzfltsjfUoHP1mv+d0nBr79JKhtX9RciSGVZgLHgf2hekijuYV6jSUaCtW QrQMjJaGue+hDBzQNYYMTRJbpdXzV4eivahSCnshuOzQWao1eLs3HFNriFOFEVEDY+b7 Y2d+r8FwpnwTTzerCnTyRP8R9JqPfjzZ/SjXMTAfThoVv4RKRXHQLbYbPiVbG11m22an zVfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JvlKoiTd; 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 a73si2532604pge.358.2019.04.18.11.24.31; Thu, 18 Apr 2019 11:24:46 -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=JvlKoiTd; 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 S2391353AbfDRSVe (ORCPT + 99 others); Thu, 18 Apr 2019 14:21:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:38682 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391653AbfDRSHq (ORCPT ); Thu, 18 Apr 2019 14:07:46 -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 40F852186A; Thu, 18 Apr 2019 18:07:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555610865; bh=nGk2md0oGYHJDMZuwhfGtIrs22cMRjtsLW9gZqtHl4g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JvlKoiTdD7G1CTOP461Z2/FeTIR7lxoIA0Aq8k9cz3MSXMgl+b1yvLa193KwYzJSH akR0TiFyMNfgbUQ2QwewIY1ZEXJjTlHBG6GbcyphgHpVZG5hzzJWS0DEdN2bI5kSmI gTDWyZjsqs/s0r5vbje1Sg21Pyw1coTUTOS7lMEI= 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 4.9 20/50] perf tests: Fix a memory leak in test__perf_evsel__tp_sched_test() Date: Thu, 18 Apr 2019 19:57:31 +0200 Message-Id: <20190418160425.201210363@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160422.455656724@linuxfoundation.org> References: <20190418160422.455656724@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 ea772d41e472..b5d0be524655 100644 --- a/tools/perf/tests/evsel-tp-sched.c +++ b/tools/perf/tests/evsel-tp-sched.c @@ -84,5 +84,6 @@ int test__perf_evsel__tp_sched_test(int subtest __maybe_unused) if (perf_evsel__test_field(evsel, "target_cpu", 4, true)) ret = -1; + perf_evsel__delete(evsel); return ret; } -- 2.19.1