Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2385292lqp; Sun, 24 Mar 2024 17:05:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVx+Nu54FqM83mGN5FZjWKGEXURH4f9PMVXEB5SXsHegSrBuI+XNX8W+piuS3A6XUj/zvKEYTlWn1LJKnwt08KaGBelHfNNQwT4u63U7A== X-Google-Smtp-Source: AGHT+IHKYjJyRdHJcAEqeHV8wsHTQ0em3T+xqichk9blMqUqbUTcyABkcqDmQoF4K2MnwzSobXVW X-Received: by 2002:a17:906:a203:b0:a45:c931:5703 with SMTP id r3-20020a170906a20300b00a45c9315703mr3254235ejy.70.1711325130617; Sun, 24 Mar 2024 17:05:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711325130; cv=pass; d=google.com; s=arc-20160816; b=Qogb0wVUfsDjQTDtBeURfOCREogNo/pPIY+u9s3j/gkEkAW6mRnG49/EPdWO3p7vpB qgScaqh9CsdhIU86W5J9RqGQouShKe8jc5j9Dm10txbHXT2rbPcPduyq/ka+NpM7cJgS 5Xk2GqAq66vNIILN2I5DtmMw+1SEP/WGI+qk5PIj2PDwo6yv4+Q4abZyYEGRO6whsPew sHqbkOddRbov/fl/dPcbOfTN5MmIn+49d+LxY5d9TTWCqfIFmYgIlmc5ksM7UgQCahvs OeJA+q/LVjKRxZdU2kbfxI063tp1YCfJssPnR+0ai6UGhYfSh5rUsrUHSJg7biTXew8N 9NdA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=5y8u45YURhRl2oCw01ZuTwmoiM3l8HYZam1BmGkOW/g=; fh=JdZcaA3zRkUQQmOEKu1nHEtvAWYd+87ibTN8k8lcbNE=; b=TVR6Ey3wPjsf3shoQPjMXrjI9cVExsoQJ4vdZDmEFpweZB8CP7BttqQ/67KJhFOk7y 3oy0Jp3LyBN73MINNVNoha3PkC0yb8FrXYGhEHYU4CfdJfPWTBFahSCBksiyH4OPcads 9CARM899VgEa/+FIN3x87ZRcjq7tFEmTD0+yEblbY1QWTF4XcP8hsQZj+du9l1A2emOc qCIBvkgk9KFMiP1Kjr+A/JUwPAuNamb1jlnPxa5Ww+v9muTAsi2lL68siditQLoMP4oI whun1gamtN0ISFz/Mq1jp4FbsB7ETeZRYxwXTqyDJWQj91vy6KISlZa2W5TO0DhAQDWm SwYg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=I9XGTGUz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113304-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113304-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id n3-20020a170906378300b00a46bd59f902si2024934ejc.653.2024.03.24.17.05.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 17:05:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113304-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=I9XGTGUz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113304-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113304-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 576A61F2258E for ; Mon, 25 Mar 2024 00:05:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E9E54191793; Sun, 24 Mar 2024 22:41:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="I9XGTGUz" 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 18B34191774; Sun, 24 Mar 2024 22:41:45 +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=1711320105; cv=none; b=liLxz8c9vWDXK3AjiU1yB0icG5HoX+WmvBkXmoUWkSB/I9rXJXfQZ1iKPKbrk1L8JPM9zcqKCqE1bGQOGfVV5ClwOgmAJ+untpjYcXzdiuvjiDlmISekyZ/UEZGM+HRag+P31mJHA5+bzP31D66YuqPIJmgaMN8Wh2uNHCuOjm0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320105; c=relaxed/simple; bh=QbjeDjnPkJo+H8tCOpPrb24g83W7AuUV2r8hVSR8c/o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tV1IJsS9hQqv45Aspdj7xYPilBwDlZkzt+ng4147zEDIFRUpDCVD9vj26BxQ7oH+S8jUKCfSzMJkmYaV3ZXMCe52LQxKMU6FoVm+5iQrM1ZwXMUc8r/jdjmRUC/fGnPbhepDg4Mh1SCv2cn20tAgS3oCJ4yV7m2fZMZQ3P7+pX4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=I9XGTGUz; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3FCC2C43394; Sun, 24 Mar 2024 22:41:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320105; bh=QbjeDjnPkJo+H8tCOpPrb24g83W7AuUV2r8hVSR8c/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I9XGTGUzsrNCLqNTw1FjT/8KGYHcZ7YVV2nV3DdtXbgP+aa7jrCXJTMGR69Ebtq7X qPFP6FjsuMr7r4O/7nbFq5ErzVUT0W0mRkSZ4Hisgn7YrbejpRw/8XrbeqU0NquKkT N/WZDWJ0jAxTHX5BxR6SSV6ZRZmCBC8sfnIaBqgMsiWhJizWVaRSWSh/Dihj5eQpYr Pc58JeeA4gI4+0UwLF4z3p2zBVQpvZ5HjTa6if7KOxpyup+BtxH8ftOLqOaJDI7sVr oJDuGonF29+k9IJ73JGYE0JJ2irHF2B3dJTBUuAO3fD5iWkffSvziIqSLT2g/QBfta wijCoOcjjhEbg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Yang Jihong , Arnaldo Carvalho de Melo , Namhyung Kim , Sasha Levin Subject: [PATCH 6.8 413/715] perf thread_map: Free strlist on normal path in thread_map__new_by_tid_str() Date: Sun, 24 Mar 2024 18:29:52 -0400 Message-ID: <20240324223455.1342824-414-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Yang Jihong [ Upstream commit 1eb3d924e3c0b8c27388b0583a989d757866efb6 ] slist needs to be freed in both error path and normal path in thread_map__new_by_tid_str(). Fixes: b52956c961be3a04 ("perf tools: Allow multiple threads or processes in record, stat, top") Reviewed-by: Arnaldo Carvalho de Melo Signed-off-by: Yang Jihong Signed-off-by: Namhyung Kim Link: https://lore.kernel.org/r/20240206083228.172607-6-yangjihong1@huawei.com Signed-off-by: Sasha Levin --- 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 e848579e61a86..ea3b431b97830 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.43.0