From mboxrd@z Thu Jan 1 00:00:00 1970 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 0D2BBC677F1 for ; Mon, 16 Jan 2023 16:57:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234054AbjAPQ5P (ORCPT ); Mon, 16 Jan 2023 11:57:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233936AbjAPQ4w (ORCPT ); Mon, 16 Jan 2023 11:56:52 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF61735270 for ; Mon, 16 Jan 2023 08:39:54 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F2B9861049 for ; Mon, 16 Jan 2023 16:39:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17136C433EF; Mon, 16 Jan 2023 16:39:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673887193; bh=hMYsCiQUGcYmL3Jyxrb5QuX0Lq42ul9xre1vEk+88v4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R7vqcmCVxMmdOW7ndQEVwqQ149kQ//MTHRKWXKDEVrH+zl4uu7AISY5d8eFV5Otq4 DbIuSznjAZOOSOMUTvoqqyHDGqHzkDAbntqt8tvpb1NdqgetDuJPE567hxJM8uSaTg 8FMPu0eCvW1/t9/jqSnI/pqRsMx9Q0PyJYgfYXgk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Xiongfeng Wang , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 4.19 057/521] cpufreq: amd_freq_sensitivity: Add missing pci_dev_put() Date: Mon, 16 Jan 2023 16:45:19 +0100 Message-Id: <20230116154849.806269453@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116154847.246743274@linuxfoundation.org> References: <20230116154847.246743274@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Xiongfeng Wang [ Upstream commit 91fda1f88c0968f1491ab150bb01690525af150a ] pci_get_device() will increase the reference count for the returned pci_dev. We need to use pci_dev_put() to decrease the reference count after using pci_get_device(). Let's add it. Fixes: 59a3b3a8db16 ("cpufreq: AMD: Ignore the check for ProcFeedback in ST/CZ") Signed-off-by: Xiongfeng Wang Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/cpufreq/amd_freq_sensitivity.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/cpufreq/amd_freq_sensitivity.c b/drivers/cpufreq/amd_freq_sensitivity.c index 4b4f128c3488..cacd4c67d9be 100644 --- a/drivers/cpufreq/amd_freq_sensitivity.c +++ b/drivers/cpufreq/amd_freq_sensitivity.c @@ -122,6 +122,8 @@ static int __init amd_freq_sensitivity_init(void) if (!pcidev) { if (!static_cpu_has(X86_FEATURE_PROC_FEEDBACK)) return -ENODEV; + } else { + pci_dev_put(pcidev); } if (rdmsrl_safe(MSR_AMD64_FREQ_SENSITIVITY_ACTUAL, &val)) -- 2.35.1