Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2895566rwr; Fri, 28 Apr 2023 19:00:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4/WwpLW4utszrSGQXWYPV5k+Tc35n5QHNDQ1qtidlBsV9EeRAyJYcoLq9CywJhoHx0Cath X-Received: by 2002:a17:90a:19d5:b0:249:78db:2635 with SMTP id 21-20020a17090a19d500b0024978db2635mr4154818pjj.0.1682733655426; Fri, 28 Apr 2023 19:00:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682733655; cv=none; d=google.com; s=arc-20160816; b=q09NAfm3fnKOcRfuYs06R0r0yrzopbqK/xX6cyFjCpg4zIcKbz1Jp0bSxVqZwOAqPb MGY5lMSmxIZgmJXBzME8lzXt9z4nHmg/f3zedpm1aXmt7CQQeyd4573VCzfuoiKL2cSU 2UJ2D3B2zwTxDWLxKNbtBUnoTDlgiOlnpbSq65hFyOuHyo4ZvfbbJfItQNtNTl+dXxLa h997/CLryBu+24OXj8JjJyoTacnLLS+me3pqbKrfPi72GJaIeuDDkrmWDFVLjOHfT/A7 +zSRLCUCvjcHtdqoirikscNqHEr5u29HNvwLdmSlx5xl0mCBukAmKrWALYIYKyw3rV0B nDMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=jge387hEmS5pShLeIW71L7XDRw9Dh2t7O1sR2DJyGYc=; b=eutMGRGUPcRBwECy53y4Dn4HTGhIBIJs69VAuhN6aQpbIQWv3uCqa2G18PQxM1s1FQ mlgHKenfVLAKia6JPR88Msl0h/aOOGxXvKf5wm3HGtUC5M9hUl0TcuiftFY4DhxWtgcU EbJtcMvMeswFY4EzI0YgoWJOckRRGFfV0JqKZon6dMtdmwdj00QevM7lmO/yR2GMf6WX KLoqNltj2A94eqKChCpYcMyG+4IrfM+PYFk1PuUKTvGiCKrN6gU3EZI0vsZzStITxtgN xTC+uJvMgibT4xdIOHTi3MwOSkr8VwKQGRHWz3DMV3lQSeBC02MJcVxldn8bmkPSN6lq rv5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jgcaqeYE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x59-20020a17090a6c4100b00240d313b97dsi25042769pjj.90.2023.04.28.19.00.40; Fri, 28 Apr 2023 19:00:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jgcaqeYE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347380AbjD2B7z (ORCPT + 99 others); Fri, 28 Apr 2023 21:59:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347341AbjD2B7n (ORCPT ); Fri, 28 Apr 2023 21:59:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F8B759F6; Fri, 28 Apr 2023 18:59:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 78CE56463B; Sat, 29 Apr 2023 01:59:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B596CC433D2; Sat, 29 Apr 2023 01:59:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682733554; bh=KmjG+Ha2oLZdWXMOG9SlZ0vpoBCQOwPNjT5M7WOr0t0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jgcaqeYE+fJURE+rgweQCzPGUooeB0JAEH6BvSDRPR6DJZlEdZ+KkRzEKopTRYO5K JaU/4gFQOw/Z0+x+lGVAMAQJaLLzV620NLpu3ZNkQuSJO/Do1O2jgnuYB8374pl8AG qs9GSbOWcZ7JFhcxUty1rGJUJH+i3f7FISjaiz6dyuHMKCBxRAV250GuzF6JNPwYq/ 46+k9iWuv+sr3YFnPlByOncUAZMcS6FzXQl/jI5UlbM8B7ErBHragdOsdhBAEDpbew TJUMsJjV18wGGrRiaXzMNRKx8JXBsUgXoFPf+4YMd1zf28J3Mv+eqRkYqGvrf1Ydjw jybsw1TJh2tEg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id EB6CC403B5; Fri, 28 Apr 2023 22:59:12 -0300 (-03) Date: Fri, 28 Apr 2023 22:59:12 -0300 From: Arnaldo Carvalho de Melo To: Yang Jihong Cc: peterz@infradead.org, mingo@redhat.com, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com, adrian.hunter@intel.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf tracepoint: Fix memory leak in is_valid_tracepoint() Message-ID: References: <20230421025953.173826-1-yangjihong1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230421025953.173826-1-yangjihong1@huawei.com> X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Apr 21, 2023 at 02:59:53AM +0000, Yang Jihong escreveu: > When is_valid_tracepoint() returns 1, need to call put_events_file() to > free `dir_path`. > > Fixes: 25a7d914274d ("perf parse-events: Use get/put_events_file()") > Signed-off-by: Yang Jihong Thanks, applied. - Arnaldo > --- > tools/perf/util/tracepoint.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/tools/perf/util/tracepoint.c b/tools/perf/util/tracepoint.c > index 89ef56c43311..92dd8b455b90 100644 > --- a/tools/perf/util/tracepoint.c > +++ b/tools/perf/util/tracepoint.c > @@ -50,6 +50,7 @@ int is_valid_tracepoint(const char *event_string) > sys_dirent->d_name, evt_dirent->d_name); > if (!strcmp(evt_path, event_string)) { > closedir(evt_dir); > + put_events_file(dir_path); > closedir(sys_dir); > return 1; > } > -- > 2.30.GIT > -- - Arnaldo