Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2652810rdb; Mon, 5 Feb 2024 13:12:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IExGAgDqTA6b/OU4K75auAz6uaYRbMb/dkK+OMNEeqdERV6vdgGcSArr6d8rfqWrmF3PHJ3 X-Received: by 2002:a0c:e452:0:b0:68c:a3e0:14f with SMTP id d18-20020a0ce452000000b0068ca3e0014fmr1303961qvm.25.1707167570753; Mon, 05 Feb 2024 13:12:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707167570; cv=pass; d=google.com; s=arc-20160816; b=GUJvxJ/xvih1rKO5+v3Mes20TnBpzx1i2eKwzObmTkt+d8pEN9UadvCD+VUuYqBzRs O9U/H1OWNB0IvR4Gzw/ZbWhi8WIefKcGYZTy8zCH1T6yKsUrKv157WwSCF+bu+KXYxVV TuiI3DOb2qPStH6n2CmEAJoOJ5agVI8ksrLAWDUo35RmkJ7t5GCo0dj/2hLZXxHO0g6o KuzfjRGfDMRhpG5764YEkMMWxJBYHxMyxvaqcKPesgS12wvrIhgFycT8gwg3SjCECg9j gHkZgsqv+wct7aGnHFrZkaMKpcQ+uPPGFqXpqFmbmtTjSA8A2KOSY7XFjbmXBzKcXv8q n28g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Im3YqNTDxuJ2qJpRYUPK0iit9Wvupq7MOk8anKsbXZ0=; fh=Y2gNhkGg7WQH0Z+cN/9i/yXBgPkLJXF+1ZaWauEqH5g=; b=y7l53gZ3KYGQ6vxvnRJaSGP8+EeZhhJzcH9uiub+TUBEsJy7zphFgaOQZWWyzWtVYR wZU6P5QniuoKzZsqH2JPdKndAkDo0fDBh9MmT1du3kn3qgXbplmLP3yDVINly7AVLNIB s/iDXGMH797yIvgaEz8WNrXxUKBZF7Nf3uSNeEpTtZn07cB39N+Z8VbzBpw2pnGhMTvb 0nRErFt9zeIZBgi5HwkPcwzDkSvZtVR2J6FeOD2zieeWQQzovh0fwE9MpihhMlGhcbSU MBmriL93TnKTS8JuQviEtbMXTcFFc1tNM4UbxW0TD0VpwbQoeBc4jyL7iNZJ7jyvi5Su ny9Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PSe+YHdd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-53801-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53801-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCUXd9wqaDJbZZB9ogILW/M8kpN9OjDdWUiDB4fRl7OmRj+1M+bNtW9GuPJL3DlRrdYnwhgnmGKxEC4mueXeu5eMVJEzz19p8gdFe2r3UQ== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d10-20020a0cfe8a000000b0068caf59c4c1si540158qvs.37.2024.02.05.13.12.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 13:12:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-53801-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PSe+YHdd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-53801-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53801-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 37AF51C265EF for ; Mon, 5 Feb 2024 21:12:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 61A4350275; Mon, 5 Feb 2024 19:09:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PSe+YHdd" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8BC8A481B1; Mon, 5 Feb 2024 19:09:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707160178; cv=none; b=ZRQx4qx958FrfxRPEkoIk4aiN90KahNxMY0CVoaTPvg+fkwtsPM2p4VgdHHVaaazRu7qwDM3+x6DwbJL3jZPfz6VOflInl0itOZWlozNgBy3FHPZz98osNYs5ePmHZKNntD7qZ6zfAY550eZ48OMb33pBBq9AGlgZ6MrIYgmmDg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707160178; c=relaxed/simple; bh=gIJqV3GMvqU06kq7guQE1A5kqVd2/defoIhiF42CLmo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KiyyaiKyfrDH07AOPk1TS90HVKdV1r/XQ5qDqtBoMSSxgA8DqmPio2G+58VpK8dplJSgy9SAm9X3fiAjegwDYMuKYZqIRnF1Fc+DNy1iIJQNC0MoiZLuBLW/r2+xBADONmgJfbWyfsaLln9ZVptMAu9ng2SeT0nPFjl0qOp9MM0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PSe+YHdd; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCB2FC433F1; Mon, 5 Feb 2024 19:09:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707160178; bh=gIJqV3GMvqU06kq7guQE1A5kqVd2/defoIhiF42CLmo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PSe+YHddlccusr7ABupcCp9O5z2Agk20uLwXqeYelTWA+p8m4oijoUwBYjkcQ99e+ LRKrCFcvW7e/yrIa7E/3kJD6xQaGb4wzGY1yWhj70QvXVLuM5zlRutfK0rVLYwS/EC RxCqGmMgoz/mOMhXWVkkh5fr0Ez6gXOssicvTxZTXDG7oR9gXL8tRxwI2P1B8kBUNT 7YXTEhos2zRjgtI5Y46BA7RV0Fp2/dKLeE3bpvU6iBwXCWsf6BJ4YyfBjdnhlesIZx t5x60q4iJjl5fkVXLLbJJgoOV5qrd0imDwZJRFQXg5n29EEoEt7urLUbxS12v/2xD2 gvrHW49p4PJbA== Date: Mon, 5 Feb 2024 16:09:32 -0300 From: Arnaldo Carvalho de Melo To: Yang Jihong Cc: peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/5] perf thread_map: Free strlist on normal path in thread_map__new_by_tid_str() Message-ID: References: <20240205104616.132417-1-yangjihong1@huawei.com> <20240205104616.132417-6-yangjihong1@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240205104616.132417-6-yangjihong1@huawei.com> On Mon, Feb 05, 2024 at 10:46:16AM +0000, Yang Jihong wrote: > slist needs to be freed in both error path and normal path in > thread_map__new_by_tid_str(). Please add: Fixes: b52956c961be3a04 ("perf tools: Allow multiple threads or processes in record, stat, top") Reviewed-by: Arnaldo Carvalho de Melo - Arnaldo > Signed-off-by: Yang Jihong > --- > tools/perf/util/thread_map.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/util/thread_map.c b/tools/perf/util/thread_map.c > index e848579e61a8..ea3b431b9783 100644 > --- a/tools/perf/util/thread_map.c > +++ b/tools/perf/util/thread_map.c > @@ -280,13 +280,13 @@ struct perf_thread_map *thread_map__new_by_tid_str(const char *tid_str) > threads->nr = ntasks; > } > out: > + strlist__delete(slist); > if (threads) > refcount_set(&threads->refcnt, 1); > return threads; > > out_free_threads: > zfree(&threads); > - strlist__delete(slist); > goto out; > } > > -- > 2.34.1