From mboxrd@z Thu Jan 1 00:00:00 1970 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 A32E015C82 for ; Mon, 5 Dec 2022 19:19:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27025C433C1; Mon, 5 Dec 2022 19:19:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1670267991; bh=qB5XqF5nkXDbgvjE1KWxNlmDbGiUjFpQU0Hoc+cvTRE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PV9LukBmDxryVXuVE8jppM/txeP10+Lz4RZYN7lPZWIuJ27R2D94UzdAExnnl08L+ /wO3W6dyfJ4E7kl6gr5S+qJeErbHpjT5wJVSlChgcIZsf/1LSf3rwJVrRhZklnrItf Iybt2twr7LlFyHfqFqsoywsTwhklYDusVLckN5LM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Xiongfeng Wang , Hans de Goede , Sasha Levin Subject: [PATCH 4.19 047/105] platform/x86: asus-wmi: add missing pci_dev_put() in asus_wmi_set_xusb2pr() Date: Mon, 5 Dec 2022 20:09:19 +0100 Message-Id: <20221205190804.736408513@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221205190803.124472741@linuxfoundation.org> References: <20221205190803.124472741@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Xiongfeng Wang [ Upstream commit d0cdd85046b15089df71a50548617ac1025300d0 ] 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 before asus_wmi_set_xusb2pr() returns. Signed-off-by: Xiongfeng Wang Link: https://lore.kernel.org/r/20221111100752.134311-1-wangxiongfeng2@huawei.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede Signed-off-by: Sasha Levin --- drivers/platform/x86/asus-wmi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 339b753ba447..3723ae37993d 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -1176,6 +1176,8 @@ static void asus_wmi_set_xusb2pr(struct asus_wmi *asus) pci_write_config_dword(xhci_pdev, USB_INTEL_XUSB2PR, cpu_to_le32(ports_available)); + pci_dev_put(xhci_pdev); + pr_info("set USB_INTEL_XUSB2PR old: 0x%04x, new: 0x%04x\n", orig_ports_available, ports_available); } -- 2.35.1