Message ID | 20230608232823.4027869-17-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 00D20C7EE37 for <linux-arm-kernel@archiver.kernel.org>; Thu, 8 Jun 2023 23:30:56 +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=qu8n03T4ZuQRPVa6s3eKqc4yEGVHXYmJoElEYO5Rfsk=; b=SdLpVvFMc3dUd8 e6+kyEzGpng1CLM6k9dlLgbZLMip07udAQz3FoQtUMSxTGADzv0MysIyZlcEW+xJhAZpeexUxtCvF /cyGUbsLdKHt2JxQdRbmQI6A/ym8SQyjChRqeB5691LmnQQiLjqantNUykV8BLgNAxN+75nPTNf3f MpdMv/C15p8LG4KP1XGvxPgHACgY8+P4I0xFxZOneN6OxT3ChasF62wcAC0mx6coIFPyop/hxOtoF uYV39/F55Cczy5z+Gg2x5CznJ+8tZ2SL7vzlqgQ1IaKH8PUtHE85Nk/MZdos7kMPu3BaVNB4MG6TI dwnzNyq4/vT5JX4fqnpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7P5K-00Avef-2o; Thu, 08 Jun 2023 23:30:30 +0000 Received: from desiato.infradead.org ([90.155.92.199]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7P5I-00AvcG-1k for linux-arm-kernel@bombadil.infradead.org; Thu, 08 Jun 2023 23:30:28 +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=HiAGlNZo6LXveOEFDnkkT89wkMT4puWq+yhAGi6vKP8=; b=R/EDN/QqS/54C+cBl7uKpl94Jx OnC30Hz7gi7E2A73vSylzGj8FFhNBEhLGZxsXhJeeRAZub8HJN7pZrltP95PAB7RmUfn/jbv1CIcr 26omHTLB/+THruOOl9V9rIbCil11G2mi1BbBmAJ2KZ/4gyBxd9eTdDiKyO/5/Qjg2n8x7hEnAHz+F zb2Lnh8NFQvAlN76K74ATRG7u+OfFh0xf7WMFgNt+y/apO5e+IHWToMe0TxZzNVcClI9YK0hCvfrO JtisrBorsK8I2V3vioF2Y93tIWWk0iApQRXlaKe0AC3cpT8FOZEBy6qmdReBfwlzTfng5bkCjWQCK H5IgTQjA==; Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7P4k-006Mqe-0r for linux-arm-kernel@lists.infradead.org; Thu, 08 Jun 2023 23:30:06 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-ba87bd29e9dso1648179276.3 for <linux-arm-kernel@lists.infradead.org>; Thu, 08 Jun 2023 16:29:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686266991; x=1688858991; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=HiAGlNZo6LXveOEFDnkkT89wkMT4puWq+yhAGi6vKP8=; b=u+3QXdLeECEvsv94B0MruS/YOXHDhV0YcI12nIU2fPum5/LYqTXJMF1kvVgDLAhd69 TB+RJB7OC/HHWpeh7KmqrHAPzNPPTDPs/OmNWO/o2KRujpqU/fSwzhmFr09RuWuqyC/T BzZ0/9JGdYaugJO93/OcTlcUa5DARHOIMgR1ocJWkQzbY1sSYakwLv32CJlgOR6HBARC gz455L472xGEXQfKqdk8T6z6OfDB3KCJWYfUVI/PGvFTO5mLQXvHOBkfeWWeIOYweQM1 /mrxG3oQpV1hhk+hqqFyeAEW0j9hksyd5d3ot94/g5G8yPxOtDBBg8z3j82W+cBjX+b7 8aNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686266991; x=1688858991; 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=HiAGlNZo6LXveOEFDnkkT89wkMT4puWq+yhAGi6vKP8=; b=Z2yihIhbWTzxg469pRqaJtReQPutrcsmJ/z/UdnLkKZdoeCpHraO3EkhJ5KtLYRm29 oEAibpOw3gneZiKXNvRV3aXDlsMGPPK7Ui6tvX7OU/2lUxdF4NQpr1ctQRw5ZI4VD7c0 UT45DRPywHp4u74e9LlRLSyjHXtKWWth5JgOR/uR2c0P80EIJPnKc+PtK2k0dMnLLdn9 OMOOufr1VPezlW2Zv74oSFpVJPG03iN2kyg0wD68ng/8eSh+wMYhHzlTjvessOTjO8Xe LwEzb+oqvcRuEh/iRyz4JQFGND6xXT+49hxRJ0MFhuAlLVJ5LjYDOITsc+AH//bsb55t uxQA== X-Gm-Message-State: AC+VfDytEO0I3/jpT6RhcNVMNMFkU9C0wtxIH+8He//DnP8r02rxSOR4 LnqrwtxGFLOQ0PTsHNYix4cjjp2bnGXD X-Google-Smtp-Source: ACHHUZ4V8g7YSjAMhsnMLI/N9elrTcMGdXKg6JQGvTOe1tUTMtyI07H4+/X7cQCtnKGmMy/p1PmmgQPPI/lf X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:c3e5:ebc6:61e5:c73f]) (user=irogers job=sendgmr) by 2002:a25:588:0:b0:ba8:3e2d:58f8 with SMTP id 130-20020a250588000000b00ba83e2d58f8mr611466ybf.5.1686266991630; Thu, 08 Jun 2023 16:29:51 -0700 (PDT) Date: Thu, 8 Jun 2023 16:28:13 -0700 In-Reply-To: <20230608232823.4027869-1-irogers@google.com> Message-Id: <20230608232823.4027869-17-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 16/26] perf symbol-elf: Correct holding a reference 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_002957_362586_19A3F519 X-CRM114-Status: GOOD ( 14.83 ) 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/symbol-elf.c b/tools/perf/util/symbol-elf.c index 63882a4db5c7..e6493d1cc251 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -1389,11 +1389,11 @@ static int dso__process_kernel_symbol(struct dso *dso, struct map *map, /* Ensure maps are correctly ordered */ if (kmaps) { int err; + struct map *tmp = map__get(map); - map__get(map); maps__remove(kmaps, map); err = maps__insert(kmaps, map); - map__put(map); + map__put(tmp); if (err) return err; }
If a reference is held, don't put it as this will confuse reference count checking. Signed-off-by: Ian Rogers <irogers@google.com> --- tools/perf/util/symbol-elf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)