From nobody Sun Apr 19 12:16:51 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 336C7C433FE for ; Thu, 24 Nov 2022 12:03:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230246AbiKXMDB (ORCPT ); Thu, 24 Nov 2022 07:03:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230173AbiKXMCv (ORCPT ); Thu, 24 Nov 2022 07:02:51 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24F041DA5B; Thu, 24 Nov 2022 04:02:50 -0800 (PST) Date: Thu, 24 Nov 2022 12:02:46 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669291368; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MhC6bmc4f+IfIIYmCCearwAZxy7ciSOUUxSt5WzBXeE=; b=W+9rkPqhVnYU5wg+2xM71y09bEFNtIfcKTQJ6cQ+2ybJT19IdS8EjNVbOM09jZCLelSTjS uZumMlNGd7Kb+3bZMOQPSZyMXTSxIYMCL1SjSjfGI+n3xKgZwMl690gjXe2IwkMzMFkhAx bWMEy/VV8pvuluHccxIEK33qyJODzr65Y5Jv01uZYm258MLdquwcQBpB2Xj1eVNgibb4Xz ysaRXsEhD0XPJVXlpfbQERlR6Q5HAV/15o1ACf/30KqTHP6i0wxoOYZVrImZS1HPOIa0NH p6lj+gqrD2sGWoljANCqUzgx03EcPR3zSddAPevRkLnEX4QJtRe+ePFberfvcg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669291368; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MhC6bmc4f+IfIIYmCCearwAZxy7ciSOUUxSt5WzBXeE=; b=tOXDDpHUMFYAATNyqm6T11zQXVhpRst4FM/MRryUPh9lTYXZbkWZ/R6mS/R3r43gpyRRdl ixmMiTCsxmzrwZDQ== From: "tip-bot2 for Xiongfeng Wang" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf/x86/intel/uncore: Fix reference count leak in snr_uncore_mmio_map() Cc: Xiongfeng Wang , "Peter Zijlstra (Intel)" , Kan Liang , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20221118063137.121512-4-wangxiongfeng2@huawei.com> References: <20221118063137.121512-4-wangxiongfeng2@huawei.com> MIME-Version: 1.0 Message-ID: <166929136687.4906.12321459785416092407.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/core branch of tip: Commit-ID: 8ebd16c11c346751b3944d708e6c181ed4746c39 Gitweb: https://git.kernel.org/tip/8ebd16c11c346751b3944d708e6c181ed= 4746c39 Author: Xiongfeng Wang AuthorDate: Fri, 18 Nov 2022 14:31:36 +08:00 Committer: Peter Zijlstra CommitterDate: Thu, 24 Nov 2022 11:09:25 +01:00 perf/x86/intel/uncore: Fix reference count leak in snr_uncore_mmio_map() pci_get_device() will increase the reference count for the returned pci_dev, so snr_uncore_get_mc_dev() will return a pci_dev with its reference count increased. We need to call pci_dev_put() to decrease the reference count. Let's add the missing pci_dev_put(). Fixes: ee49532b38dd ("perf/x86/intel/uncore: Add IMC uncore support for Sno= w Ridge") Signed-off-by: Xiongfeng Wang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kan Liang Link: https://lore.kernel.org/r/20221118063137.121512-4-wangxiongfeng2@huaw= ei.com --- arch/x86/events/intel/uncore_snbep.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/u= ncore_snbep.c index 93b0f1f..44c2f87 100644 --- a/arch/x86/events/intel/uncore_snbep.c +++ b/arch/x86/events/intel/uncore_snbep.c @@ -5111,6 +5111,8 @@ static int snr_uncore_mmio_map(struct intel_uncore_bo= x *box, =20 addr +=3D box_ctl; =20 + pci_dev_put(pdev); + box->io_addr =3D ioremap(addr, type->mmio_map_size); if (!box->io_addr) { pr_warn("perf uncore: Failed to ioremap for %s.\n", type->name);