Skip to content

Commit 1272fd6

Browse files
pawellcdnsgregkh
authored andcommitted
usb: cdns3: Fix issue with using incorrect PCI device function
PCI based platform can have more than two PCI functions. USBSS PCI Glue driver during initialization should consider only DRD/HOST/DEVICE PCI functions and all other should be ignored. This patch adds additional condition which causes that only DRD and HOST/DEVICE function will be accepted. cc: <[email protected]> Fixes: 7733f6c ("usb: cdns3: Add Cadence USB3 DRD Driver") Signed-off-by: Pawel Laszczak <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 5bc38d3 commit 1272fd6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/usb/cdns3/cdns3-pci-wrap.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ static struct pci_dev *cdns3_get_second_fun(struct pci_dev *pdev)
6060
return NULL;
6161
}
6262

63+
if (func->devfn != PCI_DEV_FN_HOST_DEVICE &&
64+
func->devfn != PCI_DEV_FN_OTG) {
65+
return NULL;
66+
}
67+
6368
return func;
6469
}
6570

0 commit comments

Comments
 (0)