Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3711726pxv; Mon, 26 Jul 2021 10:00:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdVUGtkXL3oJ5MVo5Ow7e9K/H4a1l8nMhWBYLrxSuzBu4WKvalMiuCw5unPL0jijMbvfue X-Received: by 2002:a19:2d0e:: with SMTP id k14mr13627345lfj.409.1627318854426; Mon, 26 Jul 2021 10:00:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627318854; cv=none; d=google.com; s=arc-20160816; b=NB3Dsdi0KM4bKJ6FWJoA86s5CCFCe1ZuvvIMjv3lenuloWoKWN185h+uoqZnJQ/gd5 WODsmfCqcOmk4O0dLQFXFB1mBZINW2OtCUn6el7JW3QHVEhkm0WAxFZuPJPtPHIo+px5 lVM+RMrsr3BjTLphy9V7woQPS1XYDh8zVRI6AhRfsoQQ9twPWUdcblCgNT2Ictc7OdyR v4Smx794c2Z0Hd+LLxlbqsC6uBgaDM0uNgL73cEMZWLJisa8/TV55IvPJXM+sE/wsgI1 ZUAcGJjozoN2/aaoSiDW02uDl3/jEsghb+7+d9sj905M4Ezc9lmDSXKa3USHbVQnCH55 L9rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=B9K5OyQeVQzRPHVXbFstuDQXqWM4UJQ5DTunmLkHVy0=; b=PK/GfYLQZIsLA228gTzpWSBR7KtTNvPrRRZ5bNfKB1ko62unZrNXxhs7m7Y+26Q86p ru2TebLAy6Rc9yH1HF5/YjfVP6KACXom0uJ7lIv84f0FvKolUPR3dGuHmayuMS607EvE si8ERzJw4iAz4MnogETLwAUpn6yYHln1rsGPqaYYpuu4DYkCvwKt0FbRzcT1GFIpNGO/ qq9PXb+MBLI3RH1m1pzIDQ5EmExZ8wm4je2jllupd10Zk9EhNCB2EIKmQHCQ8hi/z0HK TPsLHJBdb6InnPWXaCBY/9ChO5MgiXDDt3E76K4XQwmjKozXGZe6Z6fWES7gA4v59xna +chQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cwy+hczh; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gw8si441889ejb.264.2021.07.26.10.00.31; Mon, 26 Jul 2021 10:00:54 -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=@linuxfoundation.org header.s=korg header.b=cwy+hczh; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234605AbhGZPg7 (ORCPT + 99 others); Mon, 26 Jul 2021 11:36:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:35344 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237145AbhGZPVQ (ORCPT ); Mon, 26 Jul 2021 11:21:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 83E5460EB2; Mon, 26 Jul 2021 16:01:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627315304; bh=du2R44g+IPleoXO1Mk/o0CL0OH9xHIyDQN8c84P4nLY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cwy+hczhdR7Dghae/FJjLiH9WfIAULvDp+OVCc8NvAm9k3euvrJ/YSfXR02dQKBrF bA3OdMHPpaX0q7edVTsfwSQ2nAmx4erJjiiYmHYKpusoPkjPa1o/r8VbSdWtrt1gTE XgKczEu25BOgc0HhqCn1i8Ug4whsQ8vgL3Rvh+h8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Riccardo Mancini , Ian Rogers , Jiri Olsa , Mark Rutland , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 5.10 045/167] perf probe-file: Delete namelist in del_events() on the error path Date: Mon, 26 Jul 2021 17:37:58 +0200 Message-Id: <20210726153840.902707382@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210726153839.371771838@linuxfoundation.org> References: <20210726153839.371771838@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Riccardo Mancini [ Upstream commit e0fa7ab42232e742dcb3de9f3c1f6127b5adc019 ] ASan reports some memory leaks when running: # 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. Signed-off-by: Riccardo Mancini Fixes: e7895e422e4da63d ("perf probe: Split del_perf_probe_events()") Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/174963c587ae77fa108af794669998e4ae558338.1626343282.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- 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 bbecb449ea94..d2b98d64438e 100644 --- a/tools/perf/util/probe-file.c +++ b/tools/perf/util/probe-file.c @@ -342,11 +342,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.30.2