linux_dsm_epyc7002/drivers/usb/host
Mathias Nyman cf0ee7c60c xhci: Fix memory leak when caching protocol extended capability PSI tables - take 2
xhci driver assumed that xHC controllers have at most one custom
supported speed table (PSI) for all usb 3.x ports.
Memory was allocated for one PSI table under the xhci hub structure.

Turns out this is not the case, some controllers have a separate
"supported protocol capability" entry with a PSI table for each port.
This means each usb3 roothub port can in theory support different custom
speeds.

To solve this, cache all supported protocol capabilities with their PSI
tables in an array, and add pointers to the xhci port structure so that
every port points to its capability entry in the array.

When creating the SuperSpeedPlus USB Device Capability BOS descriptor
for the xhci USB 3.1 roothub we for now will use only data from the
first USB 3.1 capable protocol capability entry in the array.
This could be improved later, this patch focuses resolving
the memory leak.

Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reported-by: Sajja Venkateswara Rao <VenkateswaraRao.Sajja@amd.com>
Fixes: 47189098f8 ("xhci: parse xhci protocol speed ID list for usb 3.1 usage")
Cc: stable <stable@vger.kernel.org> # v4.4+
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/20200211150158.14475-1-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-12 09:51:09 -08:00
..
bcma-hcd.c
ehci-atmel.c
ehci-dbg.c
ehci-exynos.c usb: exynos: Rename Samsung and Exynos to lowercase 2020-01-09 10:53:38 +01:00
ehci-fsl.c
ehci-fsl.h
ehci-grlib.c
ehci-hcd.c
ehci-hub.c
ehci-mem.c
ehci-mv.c usb: ehci-mv: Fix missing iomem in cast 2020-01-08 17:55:25 +01:00
ehci-mxc.c
ehci-npcm7xx.c
ehci-omap.c
ehci-orion.c
ehci-pci.c
ehci-platform.c
ehci-pmcmsp.c remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
ehci-ppc-of.c
ehci-ps3.c
ehci-q.c USB: EHCI: Do not return -EPIPE when hub is disconnected 2019-12-17 16:02:49 +01:00
ehci-sched.c
ehci-sh.c
ehci-spear.c
ehci-st.c
ehci-sysfs.c
ehci-tegra.c usb: host: ehci-tegra: Remove unused fields from tegra_ehci_hcd 2020-01-09 16:21:59 +01:00
ehci-timer.c
ehci-xilinx-of.c
ehci.h
fhci-dbg.c
fhci-hcd.c
fhci-hub.c
fhci-mem.c
fhci-q.c
fhci-sched.c
fhci-tds.c
fhci.h
fotg210-hcd.c
fotg210.h
fsl-mph-dr-of.c
imx21-dbg.c
imx21-hcd.c
imx21-hcd.h
isp116x-hcd.c
isp116x.h
isp1362-hcd.c
isp1362.h
Kconfig usb: exynos: Rename Samsung and Exynos to lowercase 2020-01-09 10:53:38 +01:00
Makefile
max3421-hcd.c
ohci-at91.c
ohci-da8xx.c usb: ohci-da8xx: ensure error return on variable error is set 2020-01-08 17:34:18 +01:00
ohci-dbg.c
ohci-exynos.c usb: exynos: Rename Samsung and Exynos to lowercase 2020-01-09 10:53:38 +01:00
ohci-hcd.c
ohci-hub.c
ohci-mem.c
ohci-nxp.c
ohci-omap.c
ohci-pci.c
ohci-platform.c
ohci-ppc-of.c
ohci-ps3.c
ohci-pxa27x.c
ohci-q.c
ohci-s3c2410.c
ohci-sa1111.c
ohci-sm501.c
ohci-spear.c
ohci-st.c
ohci-tmio.c
ohci.h
oxu210hp-hcd.c usb: host: oxu210hp-hcd: fix gcc warning 2020-01-08 16:58:36 +01:00
pci-quirks.c remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
pci-quirks.h
r8a66597-hcd.c
r8a66597.h
sl811_cs.c
sl811-hcd.c
sl811.h
ssb-hcd.c
u132-hcd.c
uhci-debug.c
uhci-grlib.c
uhci-hcd.c
uhci-hcd.h
uhci-hub.c
uhci-pci.c
uhci-platform.c
uhci-q.c
xhci-dbg.c
xhci-dbgcap.c
xhci-dbgcap.h
xhci-dbgtty.c
xhci-debugfs.c
xhci-debugfs.h
xhci-ext-caps.c
xhci-ext-caps.h
xhci-histb.c
xhci-hub.c xhci: Fix memory leak when caching protocol extended capability PSI tables - take 2 2020-02-12 09:51:09 -08:00
xhci-mem.c xhci: Fix memory leak when caching protocol extended capability PSI tables - take 2 2020-02-12 09:51:09 -08:00
xhci-mtk-sch.c
xhci-mtk.c usb: mtk-xhci: Do not explicitly set the DMA mask 2019-12-30 20:11:31 +01:00
xhci-mtk.h
xhci-mvebu.c
xhci-mvebu.h
xhci-pci.c xhci: apply XHCI_PME_STUCK_QUIRK to Intel Comet Lake platforms 2020-02-10 06:56:22 -08:00
xhci-plat.c
xhci-plat.h
xhci-rcar.c
xhci-rcar.h
xhci-ring.c xhci: handle some XHCI_TRUST_TX_LENGTH quirks cases as default behaviour. 2019-12-11 15:32:19 +01:00
xhci-tegra.c usb: host: xhci-tegra: set MODULE_FIRMWARE for tegra186 2020-01-22 10:09:36 +01:00
xhci-trace.c
xhci-trace.h
xhci.c xhci: Increase STS_HALT timeout in xhci_suspend() 2019-12-11 15:32:18 +01:00
xhci.h xhci: Fix memory leak when caching protocol extended capability PSI tables - take 2 2020-02-12 09:51:09 -08:00