USB: pci-quirks: Release EHCI device reference
Subsystems (2)
PATCH 1/1 USB: pci-quirks: Release EHCI device reference
for_each_pci_dev() holds a reference to the current device. The Intel EHCI lookup breaks as soon as it finds a match, so the iterator does not get a chance to drop that reference on its next iteration.
Release the reference before leaving the loop.
Fixes 26b76798e050 ("Intel xhci: refactor EHCI/xHCI port switching")
Signed-off-by Yuho Choi <[email protected]>
--- drivers/usb/host/pci-quirks.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/host/pci-quirks.c +1 -0
@@ -1073,6 +1073,7 @@ void usb_enable_intel_xhci_ports(struct pci_dev *xhci_pdev)if (companion->class ==PCI_CLASS_SERIAL_USB_EHCI && companion->vendor ==PCI_VENDOR_ID_INTEL ) { ehci_found = true; +pci_dev_put (companion);break ; } }
Signature · 1 line
2.43.0
Quoted 9 lines · Yuho Choi
for_each_pci_dev()holds a reference to the current device. The Intel EHCI lookup breaks as soon as it finds a match, so the iterator does not get a chance to drop that reference on its next iteration.Release the reference before leaving the loop.
Fixes 26b76798e050 ("Intel xhci: refactor EHCI/xHCI port switching")Signed-off-by Yuho Choi <[email protected]>---
Reviewed-by Alan Stern <[email protected]>
Quoted 19 lines
drivers/usb/host/pci-quirks.c | 1 + 1 file changed, 1 insertion(+)drivers/usb/host/pci-quirks.c +1
-0@@ -1073,6 +1073,7 @@ void usb_enable_intel_xhci_ports(struct pci_dev *xhci_pdev)if (companion->class ==PCI_CLASS_SERIAL_USB_EHCI && companion->vendor ==PCI_VENDOR_ID_INTEL ) { ehci_found = true; +pci_dev_put (companion);break ; } }Signature · 1 line
2.43.0