linux-stable/drivers/usb/host
Jon Hunter 0b987032f8 usb: tegra: Fix allocation for the FPCI context
Commit 5c4e8d3781 ("usb: host: xhci-tegra: Add support for XUSB
context save/restore") is using the IPFS 'num_offsets' value when
allocating memory for FPCI context instead of the FPCI 'num_offsets'.

After commit cad064f1bd ("devres: handle zero size in devm_kmalloc()")
was added system suspend started failing on Tegra186. The kernel log
showed that the Tegra XHCI driver was crashing on entry to suspend when
attempting the save the USB context. On Tegra186, the IPFS context has a
zero length but the FPCI content has a non-zero length, and because of
the bug in the Tegra XHCI driver we are incorrectly allocating a zero
length array for the FPCI context. The crash seen on entering suspend
when we attempt to save the FPCI context and following commit
cad064f1bd ("devres: handle zero size in devm_kmalloc()") this now
causes a NULL pointer deference when we access the memory. Fix this by
correcting the amount of memory we are allocating for FPCI contexts.

Cc: stable@vger.kernel.org

Fixes: 5c4e8d3781 ("usb: host: xhci-tegra: Add support for XUSB context save/restore")

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20200715113842.30680-1-jonathanh@nvidia.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-23 13:21:01 +02:00
..
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile usb: renesas-xhci: Add the renesas xhci driver 2020-05-15 15:44:35 +02:00
bcma-hcd.c USB: bcma: Add a check for devm_gpiod_get 2019-11-04 15:50:38 +01:00
ehci-atmel.c usb: Remove dev_err() usage after platform_get_irq() 2019-07-30 20:29:18 +02:00
ehci-brcm.c usb: ehci: Add new EHCI driver for Broadcom STB SoC's 2020-05-13 14:28:01 +02:00
ehci-dbg.c
ehci-exynos.c usb: host: ehci-exynos: Fix error check in exynos_ehci_probe() 2020-06-18 10:40:57 +02:00
ehci-fsl.c usb: host: Stops USB controller init if PLL fails to lock 2019-07-03 18:52:20 +02:00
ehci-fsl.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
ehci-grlib.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
ehci-hcd.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
ehci-hub.c
ehci-mem.c
ehci-mv.c USB: EHCI: ehci-mv: fix less than zero comparison of an unsigned int 2020-05-19 15:11:43 +02:00
ehci-mxc.c USB: host: ehci-mxc: Add error handling in ehci_mxc_drv_probe() 2020-05-19 15:12:21 +02:00
ehci-npcm7xx.c
ehci-omap.c usb: Remove dev_err() usage after platform_get_irq() 2019-07-30 20:29:18 +02:00
ehci-orion.c usb: Remove dev_err() usage after platform_get_irq() 2019-07-30 20:29:18 +02:00
ehci-pci.c USB: ehci: reopen solution for Synopsys HC bug 2020-06-18 10:42:52 +02:00
ehci-platform.c usb/ehci-platform: Set PM runtime as active on resume 2020-05-18 18:15:40 +02:00
ehci-pmcmsp.c remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
ehci-ppc-of.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
ehci-ps3.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
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 usb: host: ehci-sh: Remove unused platform data support 2019-12-10 11:34:27 +01:00
ehci-spear.c
ehci-st.c usb: Remove dev_err() usage after platform_get_irq() 2019-07-30 20:29:18 +02:00
ehci-sysfs.c
ehci-tegra.c usb: host: ehci-tegra: Remove superfluous dev_err() message 2020-04-16 14:32:45 +02:00
ehci-timer.c
ehci-xilinx-of.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
ehci.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
fhci-dbg.c
fhci-hcd.c usb: host: fhci-hcd: annotate PIPE_CONTROL switch case with fallthrough 2020-02-19 11:08:52 +01:00
fhci-hub.c
fhci-mem.c
fhci-q.c
fhci-sched.c usb: host: use usb_endpoint_maxp instead of usb_maxpacket 2019-04-19 14:23:34 +02:00
fhci-tds.c
fhci.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
fotg210-hcd.c usb: host: fotg210: add missed clk_put calls 2019-11-04 15:53:02 +01:00
fotg210.h USB: Replace zero-length array with flexible-array member 2020-02-23 19:24:51 +01:00
fsl-mph-dr-of.c usb :fsl: Change string format for errata property 2019-07-03 18:52:20 +02:00
imx21-dbg.c usb: host: imx21: create debugfs directory under usb root 2019-11-14 11:14:54 +08:00
imx21-hcd.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
imx21-hcd.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
isp116x-hcd.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
isp116x.h
isp1362-hcd.c usb: isp1362-hcd: use devm_platform_ioremap_resource() to simplify code 2019-10-04 14:09:40 +02:00
isp1362.h usb: isp1362: Spelling s/eclusive/exclusive/ 2019-06-18 08:51:28 +02:00
max3421-hcd.c usb/max3421: remove the dummy {un,}map_urb_for_dma methods 2019-08-21 10:07:25 -07:00
ohci-at91.c USB: host: ohci-at91: Remove unused variable regs in at91_stop_hc 2019-10-15 20:01:59 +02:00
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 Merge 5.3-rc7 into usb-next 2019-09-02 19:31:18 +02:00
ohci-hub.c
ohci-mem.c usb: host: Fix excessive alignment restriction for local memory allocations 2019-06-28 07:57:07 +02:00
ohci-nxp.c usb: ohci-nxp: fix use of integer as pointer 2019-11-04 15:50:38 +01:00
ohci-omap.c
ohci-pci.c usb: hci: add hc_driver as argument for usb_hcd_pci_probe 2020-05-15 15:44:34 +02:00
ohci-platform.c usb/ohci-platform: Fix a warning when hibernating 2020-05-18 18:15:39 +02:00
ohci-ppc-of.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
ohci-ps3.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
ohci-pxa27x.c usb: host: ohci-pxa27x: Fix and & vs | typo 2019-08-21 09:59:30 -07:00
ohci-q.c
ohci-s3c2410.c usb: ohci-s3c2410: Remove set but not used variable 'hcd' 2019-06-03 15:21:57 +02:00
ohci-sa1111.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
ohci-sm501.c USB: ohci-sm501: Add missed iounmap() in remove 2020-06-18 10:42:53 +02:00
ohci-spear.c USB: ohci-spear: Remove set but not used variable 'ohci' 2019-06-03 15:21:57 +02:00
ohci-st.c usb: Remove dev_err() usage after platform_get_irq() 2019-07-30 20:29:18 +02:00
ohci-tmio.c usb/ohci-tmio: remove the HCD_DMA flag 2019-09-03 15:26:05 +02:00
ohci.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
oxu210hp-hcd.c usb: host: oxu210hp-hcd: fix gcc warning 2020-01-08 16:58:36 +01:00
pci-quirks.c USB/PHY driver updates for 5.8-rc1 2020-06-07 09:42:16 -07:00
pci-quirks.h usb: pci-quirks: Minor cleanup for AMD PLL quirk 2019-07-25 10:40:02 +02:00
r8a66597-hcd.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
r8a66597.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
sl811-hcd.c usb: host: sl811-hcd: remove useless cast for driver.name 2020-02-19 11:10:27 +01:00
sl811.h
sl811_cs.c
ssb-hcd.c
u132-hcd.c usb: host: u132-hcd: Remove u132_static_list and list head u132_list 2020-04-16 14:32:46 +02:00
uhci-debug.c
uhci-grlib.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
uhci-hcd.c USB: drop HCD_LOCAL_MEM flag 2019-06-03 16:00:08 +02:00
uhci-hcd.h
uhci-hub.c
uhci-pci.c usb: hci: add hc_driver as argument for usb_hcd_pci_probe 2020-05-15 15:44:34 +02:00
uhci-platform.c usb: add a HCD_DMA flag instead of guestimating DMA capabilities 2019-08-21 10:03:35 -07:00
uhci-q.c
xhci-dbg.c
xhci-dbgcap.c usb: host: Remove call to memset after dma_alloc_coherent 2019-07-25 11:10:54 +02:00
xhci-dbgcap.h
xhci-dbgtty.c usb: xhci: dbc: Use GFP_KERNEL instead of GFP_ATOMIC in 'xhci_dbc_alloc_requests()' 2019-09-03 15:49:11 +02:00
xhci-debugfs.c usb: xhci: fix __le32/__le64 accessors in debugfs code 2019-10-28 17:47:08 +01:00
xhci-debugfs.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
xhci-ext-caps.c xhci-ext-caps.c: Add missing platform_device_put() on error in xhci_create_intel_xhci_sw_pdev() 2019-10-04 14:37:53 +02:00
xhci-ext-caps.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
xhci-histb.c usb: host: hisilicon: convert to devm_platform_get_and_ioremap_resource 2020-03-24 12:09:39 +01:00
xhci-hub.c xhci: prevent bus suspend if a roothub port detected a over-current condition 2020-04-21 16:27:38 +02:00
xhci-mem.c xhci: Wait until link state trainsits to U0 after setting USB_SS_PORT_LS_U0 2020-03-12 17:34:49 +01:00
xhci-mtk-sch.c usb: xhci-mtk: fix the failure of bandwidth allocation 2020-07-21 14:05:49 +02:00
xhci-mtk.c usb: host: xhci-mtk: avoid runtime suspend when removing hcd 2020-06-24 16:03:41 +02:00
xhci-mtk.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
xhci-mvebu.c usb: host: xhci: mvebu: add reset on resume quirk 2019-01-30 09:22:35 +01:00
xhci-mvebu.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
xhci-pci-renesas.c usb: renesas-xhci: include correct header for get_unaligned_le16() 2020-05-18 17:36:17 +02:00
xhci-pci.c usb: xhci: Fix ASM2142/ASM3142 DMA addressing 2020-07-21 14:05:49 +02:00
xhci-pci.h usb: xhci: make symbols static 2020-05-19 14:11:55 +02:00
xhci-plat.c usb/xhci-plat: Set PM runtime as active on resume 2020-05-18 18:15:40 +02:00
xhci-plat.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
xhci-rcar.c usb: host: xhci-rcar: Use xhci_plat_priv.quirks instead of code settings 2019-09-03 15:53:27 +02:00
xhci-rcar.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
xhci-ring.c usb: xhci: Fix NULL pointer dereference when enqueuing trbs from urb sg list 2020-05-14 13:44:37 +02:00
xhci-tegra.c usb: tegra: Fix allocation for the FPCI context 2020-07-23 13:21:01 +02:00
xhci-trace.c
xhci-trace.h USB: host: Use the correct style for SPDX License Identifier 2020-04-16 14:32:46 +02:00
xhci.c xhci: Poll for U0 after disabling USB2 LPM 2020-06-24 16:03:41 +02:00
xhci.h xhci: Fix incorrect EP_STATE_MASK 2020-06-24 16:03:41 +02:00