Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp887659yba; Thu, 18 Apr 2019 11:13:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxvn3y3R7Llx+fv8NgMMjjYxX6t4kAFeWWtmIz72cX47nnNICeWc7aOIZEKmKzCMtT+v2yB X-Received: by 2002:a63:e850:: with SMTP id a16mr86286344pgk.195.1555611236009; Thu, 18 Apr 2019 11:13:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555611236; cv=none; d=google.com; s=arc-20160816; b=b+ODTpoWkWgq8R6H7oi0Z4d7hm37eFUksBPmQTOMxbmDjGb9IY3ndI2LQoDDDnOuLQ kprEzJPva/fMFvLMU5dalPAN1h50yTONY8cBESxJYCY+ZKPNJFccx7WZnbyaIJeL9yNY /rTR+z8cp2/8SQUnEDKfBpuvKVQJRw1vGxaCa981rrzif/Ug17eeLc7m7Cddchd/w0cf 2BsCyFyNp19vPF9+hzyhP4AnJu7+VZVZOtIqgxxszxEZhtVhdmLmE9W9d7T14bgEvvKg IicEp3VBCJDId6Jj5kyW5HM1z5FtWHlcheJQvGiwlGT4RGSNeV6Ie2vKYfKTYfXuJJnd tDVQ== 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=MvEG5Brcw/fgyIVVM3RKr/+f4CfYvy9A6+Zw4nW7RbY=; b=m3T24GGW/xlYt2aovHto8m3+QVEtWCl7sBNuuNYNN+1HvM8kiefE1rV/LMYp9MMOI6 SWpUXxUAzx9nYfKVtlMsB9A4ZErbYDF2Lm5fDl9HQCv6BsdGWHmv57mSlE9fd63ncC53 zGJoEpeNDFZZnnFHbCI5sIJj6ohbxwVB9+5KwY1RmlextizYs4COM218n4qRsr1YENND DCxtcwyBtH1y1hAAlArUdTG63Bkb8XDdqE7h6ZMqi9qRkDWQPVTge4DmUvCH3lUAV6Jt iaIlKWiO/k6K1//o47BZpnq3jHQehUD3iIgCfyvQkVwyWeh/6XSom7VTP2Tlqdr4qgXq kEfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PTC3icgF; 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 d25si2616720pgb.229.2019.04.18.11.13.41; Thu, 18 Apr 2019 11:13:55 -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=PTC3icgF; 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 S2391975AbfDRSMF (ORCPT + 99 others); Thu, 18 Apr 2019 14:12:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:44426 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404012AbfDRSME (ORCPT ); Thu, 18 Apr 2019 14:12:04 -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 DC9CA206B6; Thu, 18 Apr 2019 18:12:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555611123; bh=BRKte31lEDPFn5g4yhMtFQhj4wb4okRT7tVYLUOlF+U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PTC3icgFS5RoUguWrkaiPRRKlPFQAjR8gykkjEfMdOcffPyASB931En8fPKLjvCfh CkKazxj4+U3u8NJsuROu2I8szIaYKenXLlHdmylSp+uaF8Co7jgnRAYfmRZSj7I3+b U5354Cc+N27MsQfPeSnuauCsijqFxmkl4GBTMMvs= 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 34/93] perf list: Dont forget to drop the reference to the allocated thread_map Date: Thu, 18 Apr 2019 19:57:12 +0200 Message-Id: <20190418160440.571252105@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 39df730b09774bd860e39ea208a48d15078236cb ] Detected via gcc's ASan: Direct leak of 2048 byte(s) in 64 object(s) allocated from: 6 #0 0x7f606512e370 in __interceptor_realloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xee370) 7 #1 0x556b0f1d7ddd in thread_map__realloc util/thread_map.c:43 8 #2 0x556b0f1d84c7 in thread_map__new_by_tid util/thread_map.c:85 9 #3 0x556b0f0e045e in is_event_supported util/parse-events.c:2250 10 #4 0x556b0f0e1aa1 in print_hwcache_events util/parse-events.c:2382 11 #5 0x556b0f0e3231 in print_events util/parse-events.c:2514 12 #6 0x556b0ee0a66e in cmd_list /home/changbin/work/linux/tools/perf/builtin-list.c:58 13 #7 0x556b0f01e0ae in run_builtin /home/changbin/work/linux/tools/perf/perf.c:302 14 #8 0x556b0f01e859 in handle_internal_command /home/changbin/work/linux/tools/perf/perf.c:354 15 #9 0x556b0f01edc8 in run_argv /home/changbin/work/linux/tools/perf/perf.c:398 16 #10 0x556b0f01f71f in main /home/changbin/work/linux/tools/perf/perf.c:520 17 #11 0x7f6062ccf09a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a) 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: 89896051f8da ("perf tools: Do not put a variable sized type not at the end of a struct") Link: http://lkml.kernel.org/r/20190316080556.3075-3-changbin.du@gmail.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/util/parse-events.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 920e1e6551dd..9afd0d2beef5 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -2271,6 +2271,7 @@ static bool is_event_supported(u8 type, unsigned config) perf_evsel__delete(evsel); } + thread_map__put(tmap); return ret; } -- 2.19.1