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 62E1515C82 for ; Mon, 5 Dec 2022 19:15:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB185C433D6; Mon, 5 Dec 2022 19:15:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1670267739; bh=lGQ9ln1wKdpywa3Ov9pWof6VapfVprGgcKObvgGnT4o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AnyZ2/lQx7n3C5794FS+6ONLzzNM3to1s+OqIzz56t6fL4X5fIegS+G3MjOnOShs9 +p53qtZQGNyRc2sh+2ezihf+DATjW3nF8f0N7lSRrqhr80RzewKrkzOO3mGVLrKzsn 6wmEYJEDU6mguKWGXU/i6h3NW10mya35RGlf2j1c= 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.14 33/77] platform/x86: asus-wmi: add missing pci_dev_put() in asus_wmi_set_xusb2pr() Date: Mon, 5 Dec 2022 20:09:24 +0100 Message-Id: <20221205190802.042210047@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221205190800.868551051@linuxfoundation.org> References: <20221205190800.868551051@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 af26ca49996d..ca17ab9873e2 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -1107,6 +1107,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