linux/drivers/usb/core
Schmid, Carsten 76da906ad7 usb: hcd: use managed device resources
Using managed device resources in usb_hcd_pci_probe() allows devm usage for
resource subranges, such as the mmio resource for the platform device
created to control host/device mode mux, which is a xhci extended
capability, and sits inside the xhci mmio region.

If managed device resources are not used then "parent" resource
is released before subrange at driver removal as .remove callback is
called before the devres list of resources for this device is walked
and released.

This has been observed with the xhci extended capability driver causing a
use-after-free which is now fixed.

An additional nice benefit is that error handling on driver initialisation
is simplified much.

Signed-off-by: Carsten Schmid <carsten_schmid@mentor.com>
Tested-by: Carsten Schmid <carsten_schmid@mentor.com>
Reviewed-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Fixes: fa31b3cb2a ("xhci: Add Intel extended cap / otg phy mux handling")
Cc: <stable@vger.kernel.org> # v4.19+

Link: https://lore.kernel.org/r/1566569488679.31808@mentor.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-28 22:48:37 +02:00
..
buffer.c usb: add a hcd_uses_dma helper 2019-08-15 15:18:05 +02:00
config.c USB: Fix slab-out-of-bounds write in usb_get_bos_descriptor 2019-05-21 10:08:55 +02:00
devices.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
devio.c usb: usbfs: fix double-free of usb memory upon submiturb error 2019-08-05 17:27:52 +02:00
driver.c USB: core: Fix bug caused by duplicate interface PM usage counter 2019-04-19 21:15:13 +02:00
endpoint.c USB: core: move existing SPDX tags to top of the file 2017-11-03 10:12:26 +01:00
file.c USB: core: Fix races in character device registration and deregistraion 2019-08-12 22:47:24 +02:00
generic.c USB: Fix configuration selection issues introduced in v4.20.0 2019-02-08 10:22:39 +01:00
hcd-pci.c usb: hcd: use managed device resources 2019-08-28 22:48:37 +02:00
hcd.c usb: add a hcd_uses_dma helper 2019-08-15 15:18:05 +02:00
hub.c usb: Handle USB3 remote wakeup for LPM enabled devices correctly 2019-07-03 18:40:49 +02:00
hub.h usb: hub: add retry routine after intr URB submit error 2019-01-18 09:58:04 +01:00
Kconfig usb: remove redundant 'default n' from Kconfig-s 2019-05-21 10:06:22 +02:00
ledtrig-usbport.c USB: leds: fix regression in usbport led trigger 2019-01-18 09:55:05 +01:00
Makefile usb: core: add a wrapper for the USB PHYs on the HCD 2018-03-09 09:43:53 -08:00
message.c USB: CDC: fix sanity checks in CDC union parser 2019-08-15 14:49:16 +02:00
notify.c USB: core: Remove usbfs_mutex 2019-06-26 10:28:09 +08:00
of.c usb: Change usb_of_get_companion_dev() place to usb/common 2018-09-10 20:40:29 +02:00
otg_whitelist.h USB: core: Remove redundant license text 2017-11-04 11:55:39 +01:00
phy.c usb: core: comply to PHY framework 2019-01-30 09:22:35 +01:00
phy.h usb: core: comply to PHY framework 2019-01-30 09:22:35 +01:00
port.c usb: export firmware port location in sysfs 2018-10-02 12:05:30 -07:00
quirks.c USB: Fix chipmunk-like voice when using Logitech C270 for recording audio. 2019-06-05 11:52:42 +02:00
sysfs.c usb: setup authorized_default attributes using usb_bus_notify 2019-08-08 16:07:34 +02:00
urb.c USB: core: urb: Use struct_size() in kmalloc() 2019-01-08 16:46:46 +01:00
usb-acpi.c usb: assign ACPI companions for embedded USB devices 2019-01-25 08:46:26 +01:00
usb.c Driver Core and debugfs changes for 5.3-rc1 2019-07-12 12:24:03 -07:00
usb.h usb: setup authorized_default attributes using usb_bus_notify 2019-08-08 16:07:34 +02:00