Skip to content
Commit 0aa1e87a authored by Schmid, Carsten's avatar Schmid, Carsten Committed by Greg Kroah-Hartman
Browse files

usb: hcd: use managed device resources

commit 76da906a

 upstream.

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: default avatarCarsten Schmid <carsten_schmid@mentor.com>
Tested-by: default avatarCarsten Schmid <carsten_schmid@mentor.com>
Reviewed-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Fixes: fa31b3cb

 ("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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c07f658d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment