Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a6dbbf0e authored by Sriharsha Allenki's avatar Sriharsha Allenki Committed by Gerrit - the friendly Code Review server
Browse files

xhci: Fix NULL pointer dereference with xhci_irq() for shared_hcd



Commit ("f068090426ea xhci: Fix leaking USB3 shared_hcd
at xhci removal") sets xhci_shared_hcd to NULL without
stopping xhci host. This results into a race condition
where shared_hcd (super speed roothub) related interrupts
are being handled with xhci_irq happens when the
xhci_plat_remove is called and shared_hcd is set to NULL.
Fix this by setting the shared_hcd to NULL only after the
controller is halted and no interrupts are generated.

Change-Id: I2c7e460c171eacbf26d0bf7185d563ddb9efb504
Signed-off-by: default avatarSriharsha Allenki <sallenki@codeaurora.org>
parent 4a00f6e6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -407,10 +407,10 @@ static int xhci_plat_remove(struct platform_device *dev)

	device_remove_file(&dev->dev, &dev_attr_config_imod);
	usb_remove_hcd(shared_hcd);
	xhci->shared_hcd = NULL;
	usb_phy_shutdown(hcd->usb_phy);

	usb_remove_hcd(hcd);
	xhci->shared_hcd = NULL;
	usb_put_hcd(shared_hcd);

	clk_disable_unprepare(clk);