Message ID | 20230608232823.4027869-13-irogers@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 57983C7EE25 for <linux-arm-kernel@archiver.kernel.org>; Thu, 8 Jun 2023 23:30:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Subject:References:Mime-Version :Message-Id:In-Reply-To:Date:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ErPGfieVj06GTWAzJP4BQgIz0kihcM9VSwttlSCF/OU=; b=xY8wxqhACDJGVj tt2Xf5I7R/4TUGR1pdQadFanXQIdP/EHpgRmvbn0J5YfSpqAnu087cdtrSVeaWlVGqPP2sQh8JA3s DgqpMiV6iP9E+91eznms30oq52Oy8Y4qFAzWrpT0U21V41Y1e9Y4XKYVGMukmLO7tBf1RczQ33v3U gn95jpY9kPOhUmyteFdYMem6oPYsT4jKU8sfwNKwV8eI9Eqx81xcLEOZAXV29MwgXZZjU9/xxmcEX /rZQb4N2zA2FKal7oX/SRvaznCNegrLVQOtG5MAhy5DE7NoI+0SOVsGHqAMjBl54s1tPBE/FhGzGT 8sedjZwhQJ/U8g9naYbw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7P4w-00AvLY-2I; Thu, 08 Jun 2023 23:30:06 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7P4r-00AvHf-2I for linux-arm-kernel@bombadil.infradead.org; Thu, 08 Jun 2023 23:30:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:To:From:Subject: References:Mime-Version:Message-Id:In-Reply-To:Date:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description; bh=cxVt6j8z1zIEddbGRdbnpWEVyu2s2AhOUuVVlGcUcvA=; b=QbFKVyqwewlDRW3kMrC+XVOFwZ iYSF3aRD5Oogbh3GnHKswigo5o5cqGPkU2n2s/C+Nf0F8BDbiyfg97nL5jeDumC89LpsT/HQgN5vh FAHzhTHgmL/f6p+LDrexz0SajWiUzPBvkDd3wPt7iKK159P/3OY+VKtz/zBDEzZd28BeNIVln/TCY +Ez/6eES+FjP5XUO7krA5BA8YEPBzJ8agbQH7t2OaapcvNsugR9Vj9cQUeZb04+eGpdZvQWZCFn0M yN83UQ8b34VN6qz4Vc8C/jL9sSK59IynDZM908lJpHRCBCLvEUM9vwuaNauFRWTl3rO9N4hwWEVms cBUBlX7A==; Received: from mail-yw1-x114a.google.com ([2607:f8b0:4864:20::114a]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7P4a-006MpV-0U for linux-arm-kernel@lists.infradead.org; Thu, 08 Jun 2023 23:29:55 +0000 Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-5655d99da53so25391167b3.0 for <linux-arm-kernel@lists.infradead.org>; Thu, 08 Jun 2023 16:29:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686266981; x=1688858981; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=cxVt6j8z1zIEddbGRdbnpWEVyu2s2AhOUuVVlGcUcvA=; b=ZDaKU3gh0whGBinBkCTBD7l56ny7TFWktGEZvsQMsPvV9tisV+0JT41exFAx8f6gPi zL3CSPldjAK2Tum+6BzTspyaRIu5wm+1PoXPeSjrfOL1NY7BMfHgvo9JlyLedqUh8Oi+ ya3aNjwm6T7pwaa/Uik0jkBtYS9Z0Nz1ywYTRuab3h9NhtucJbP8VbA2TzT5gIYfYcsA 6Cfor+XWTdxq+SohC7OZmWQA7FEak49o/YJEpOAAvnoT1BhGSQrtYsCAaqala9qpeEOC z60k3sB64OJ+I4/JV0EuFtLt0nJqfzd8OBui4LSHZMvwTUyUfT8rxZ9oJawMBrse0Ljf qpIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686266981; x=1688858981; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cxVt6j8z1zIEddbGRdbnpWEVyu2s2AhOUuVVlGcUcvA=; b=AgY0oQg/HhHZQNKFZuX3LprZCQ9sMK+6bK8iY//dDFHfywOhqJwtEJ24qMdiD2u/T1 ID4EfhfileMKqxE1vWpRRNf3IZ6mw/eRa4ng6alJrowSgEKMVo2Us28bTFgKwEnGd3S1 7QE/Qn9qK8LhCA7UPHPbS0dtty3CdDquq4lsWXtx7yBk56h/T+TgyvqM44GPhiimpsG0 Ox0CMz60vlLHxBXON/TBObRWJhpKvpzUl+B/CDjbu3eGu4AHipVNn4+RearMe0Db9VTB u3KRnsNc3EM8Ihfz1vZ2tEDf30CQIttltpIutQGPnHpsnFEnmK33aT+KEl/ygeO5CjRF U64g== X-Gm-Message-State: AC+VfDweOaAfhVgO64a/DX2yECwQpul0Jtv6y44tMchMk6uGcQaIX6MD s9SUUlyb7kh0g1giTzwb2LstJ8Vg6Wok X-Google-Smtp-Source: ACHHUZ7n4Icj81DhdrrgIFwHFE3eedXZ++Aq+OOgMSXdAebV/QYv7OE0ML9Jkqv1obQo2p7dDDiW5LZxa8Rz X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:c3e5:ebc6:61e5:c73f]) (user=irogers job=sendgmr) by 2002:a05:690c:2b8f:b0:561:4723:2088 with SMTP id en15-20020a05690c2b8f00b0056147232088mr590334ywb.4.1686266981201; Thu, 08 Jun 2023 16:29:41 -0700 (PDT) Date: Thu, 8 Jun 2023 16:28:09 -0700 In-Reply-To: <20230608232823.4027869-1-irogers@google.com> Message-Id: <20230608232823.4027869-13-irogers@google.com> Mime-Version: 1.0 References: <20230608232823.4027869-1-irogers@google.com> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog Subject: [PATCH v2 12/26] perf intel-pt: Fix missed put and leak From: Ian Rogers <irogers@google.com> To: John Garry <john.g.garry@oracle.com>, Will Deacon <will@kernel.org>, James Clark <james.clark@arm.com>, Mike Leach <mike.leach@linaro.org>, Leo Yan <leo.yan@linaro.org>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>, Ian Rogers <irogers@google.com>, Adrian Hunter <adrian.hunter@intel.com>, Suzuki K Poulose <suzuki.poulose@arm.com>, "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>, Kan Liang <kan.liang@linux.intel.com>, German Gomez <german.gomez@arm.com>, Ali Saidi <alisaidi@amazon.com>, Jing Zhang <renyu.zj@linux.alibaba.com>, Athira Rajeev <atrajeev@linux.vnet.ibm.com>, Miguel Ojeda <ojeda@kernel.org>, ye xingchen <ye.xingchen@zte.com.cn>, Liam Howlett <liam.howlett@oracle.com>, Dmitrii Dolgov <9erthalion6@gmail.com>, Yang Jihong <yangjihong1@huawei.com>, K Prateek Nayak <kprateek.nayak@amd.com>, Changbin Du <changbin.du@huawei.com>, Ravi Bangoria <ravi.bangoria@amd.com>, Sean Christopherson <seanjc@google.com>, Andi Kleen <ak@linux.intel.com>, "Steinar H. Gunderson" <sesse@google.com>, Yuan Can <yuancan@huawei.com>, Brian Robbins <brianrob@linux.microsoft.com>, liuwenyu <liuwenyu7@huawei.com>, Ivan Babrou <ivan@cloudflare.com>, Fangrui Song <maskray@google.com>, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, coresight@lists.linaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230609_002945_833507_C82E106C X-CRM114-Status: GOOD ( 11.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
Fix memory leaks (was reference count checking for thread)
|
expand
|
diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c index 783ce61c6d25..dbf0bc71a63b 100644 --- a/tools/perf/util/intel-pt.c +++ b/tools/perf/util/intel-pt.c @@ -1280,6 +1280,7 @@ static void intel_pt_add_br_stack(struct intel_pt *pt, pt->kernel_start); sample->branch_stack = pt->br_stack; + thread__put(thread); } /* INTEL_PT_LBR_0, INTEL_PT_LBR_1 and INTEL_PT_LBR_2 */ @@ -3580,6 +3581,7 @@ static void intel_pt_free(struct perf_session *session) zfree(&pt->chain); zfree(&pt->filter); zfree(&pt->time_ranges); + zfree(&pt->br_stack); free(pt); }
Add missing put and free, detected with leak sanitizer. Signed-off-by: Ian Rogers <irogers@google.com> --- tools/perf/util/intel-pt.c | 2 ++ 1 file changed, 2 insertions(+)