summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorXiongfeng Wang <wangxiongfeng2@huawei.com>2022-11-11 13:07:52 +0300
committerHans de Goede <hdegoede@redhat.com>2022-11-15 19:15:47 +0300
commitd0cdd85046b15089df71a50548617ac1025300d0 (patch)
treed10b0074b72ec679174ecccc929f54d301cdc33a /drivers/platform
parent2dbfb3f33350e1e868d3d7ed4c176d8777150878 (diff)
downloadlinux-d0cdd85046b15089df71a50548617ac1025300d0.tar.xz
platform/x86: asus-wmi: add missing pci_dev_put() in asus_wmi_set_xusb2pr()
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 <wangxiongfeng2@huawei.com> Link: https://lore.kernel.org/r/20221111100752.134311-1-wangxiongfeng2@huawei.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/asus-wmi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 6e8e093f96b3..872efc1d5b36 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1738,6 +1738,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);
}