Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp695812pxv; Thu, 15 Jul 2021 13:43:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCkJ05CL70CvxcvhiUEqJUxrEILlBq9kFWxqHSOhm6ryE4TXZrNCr6hdrMH4ISqN7uoBTf X-Received: by 2002:a17:906:388b:: with SMTP id q11mr7473928ejd.43.1626381788686; Thu, 15 Jul 2021 13:43:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626381788; cv=none; d=google.com; s=arc-20160816; b=GALFYn7CReRMtjbhyOACEjzjPs93/KaekHxmvDSrKIPI7A7DjhH2725KqljLWuxzLZ Djy791O7c6SIvgoDXKMgrrTh0YrjFM/6tM9z1RO6118QJ2oXFV3Damwpf5rpQdEQXZ+M Z1dqtnbsCFms+0SKffWQZVrSSKIO/nD0RVffrO/q01qb8UhMJkOvqJSmJY2pyl+m0jKp tZIyv53Pjr8ZTZUtwqw8H274lsNVDRkBcChaKOyoOMWZPBUuyysIC7ZyZ5PgPsUQO1UL Evt5OG49CHEWxhNl7RxoopZtqmFhUP1ZNXkvqh7+3fMPYWNPlGJQALWcpkEUigISSgmg ILGQ== 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=mysCIPePBhGccjgwqFvwTKYzoUZ9wH8oCEHCDhmSRNc=; b=nZXhIK1DWNRBPWln2gHKCzS540mto95vfpGbA2nmV+BO/n7qlwac8WHFp+U7qKOW2/ 8UtNv/y8eL9tWHaxvZ+lIXh2ApDqB6Q+ka9UgWSiPzpHuOUlRp6TWxuxAYNcBLlvPabr QABfW8uBS4F3QgKTsrHiIYDp95sAzwRdgBVrJNPCczCLDvIn4Lrm7bKBDHbbSIwjusYm oFnBwYnUIkQ2G36MNSudZiz0vNCI++NcgWwUgOWSiOIZG+DcxcLuy33UVG1gzbDDEar+ AHE1pFJycbejOQfRu53ZDSAtKZIwhnT46YNV9UTylrCZrZrZzJSyTGQkNiobWVwpVV71 eTfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZgX7RCV1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h16si8537056eds.56.2021.07.15.13.42.43; Thu, 15 Jul 2021 13:43:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZgX7RCV1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S237025AbhGOUo0 (ORCPT + 99 others); Thu, 15 Jul 2021 16:44:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:60428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232123AbhGOUo0 (ORCPT ); Thu, 15 Jul 2021 16:44:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2D386600CC; Thu, 15 Jul 2021 20:41:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626381692; bh=bkDEIMWl5CaS9HGBWR8W6BsVY6VHXUM4aZ0On1Vy+so=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZgX7RCV1DyrboIvApF1XpuKL6eHlI9k5lum4mLxhmRoyuJ1B8Mz9fjQpv/pDqcZSp p63lTsHY9kgtGZq+Bq6Jd11Ln4eV5aXdbmgfUkXpoqn4PR6a7b2HhrqU/+OEpyRrmV SuXylsASi2eKIcqiGO0EQ5XZJLyHd78t9+vAh8NKC9r3FoRGDGFe2HHlgSDxN91bVV ASw2fgGbDmXASabYl4YLw3aGvrGwSOkoi4ptQQclOL7u561seh6AasYaGDcU/Yg0d+ 6fRtvyHf/dDXReyWAfNVDEL5/NKFNZ3hzRQyBu56eMiGTh8F8zXPvrKc1WcBk982gu VFk3y5fyEcv/Q== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 11C97403F2; Thu, 15 Jul 2021 17:41:30 -0300 (-03) Date: Thu, 15 Jul 2021 17:41:30 -0300 From: Arnaldo Carvalho de Melo To: Riccardo Mancini Cc: Ian Rogers , Namhyung Kim , Peter Zijlstra , Ingo Molnar , Mark Rutland , Jiri Olsa , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: Re: [PATCH 20/20] perf util/probe-file: delete namelist on error in del_events Message-ID: References: <174963c587ae77fa108af794669998e4ae558338.1626343282.git.rickyman7@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <174963c587ae77fa108af794669998e4ae558338.1626343282.git.rickyman7@gmail.com> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, Jul 15, 2021 at 06:07:25PM +0200, Riccardo Mancini escreveu: > ASan reports some memory leaks when running the perf test > "42: BPF filter". > This second leak is caused by a strlist not being dellocated on error > inside probe_file__del_events. > > This patch adds a goto label before the deallocation and makes the error > path jump to it. Fixes: e7895e422e4da63d ("perf probe: Split del_perf_probe_events()") Thanks, applied. - Arnaldo > Signed-off-by: Riccardo Mancini > --- > tools/perf/util/probe-file.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c > index f9a6cbcd641501b8..3d50de3217d50ae1 100644 > --- a/tools/perf/util/probe-file.c > +++ b/tools/perf/util/probe-file.c > @@ -377,11 +377,11 @@ int probe_file__del_events(int fd, struct strfilter *filter) > > ret = probe_file__get_events(fd, filter, namelist); > if (ret < 0) > - return ret; > + goto out; > > ret = probe_file__del_strlist(fd, namelist); > +out: > strlist__delete(namelist); > - > return ret; > } > > -- > 2.31.1 > -- - Arnaldo