usb: dwc_otg: fix memory corruption in dwc_otg driver
authorPaul Zimmerman <Paul.Zimmerman@synopsys.com>
Tue, 4 Feb 2014 19:21:24 +0000 (11:21 -0800)
committerRaspbian kernel package updater <root@raspbian.org>
Sat, 31 Mar 2018 14:57:37 +0000 (15:57 +0100)
commit128cbca6aa55382fbe4538c110013784b9352833
tree2df6388b83559b466e29faa49323573f660f3e2f
parenta98d5c581217d68a440c87d8080429b259a86196
usb: dwc_otg: fix memory corruption in dwc_otg driver

[Upstream commit 51b1b6491752ac066ee8d32cc66042fcc955fef6]

The move from the staging tree to the main tree exposed a
longstanding memory corruption bug in the dwc2 driver. The
reordering of the driver initialization caused the dwc2 driver
to corrupt the initialization data of the sdhci driver on the
Raspberry Pi platform, which made the bug show up.

The error is in calling to_usb_device(hsotg->dev), since ->dev
is not a member of struct usb_device. The easiest fix is to
just remove the offending code, since it is not really needed.

Thanks to Stephen Warren for tracking down the cause of this.

Reported-by: Andre Heider <a.heider@gmail.com>
Tested-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[lukas: port from upstream dwc2 to out-of-tree dwc_otg driver]
Signed-off-by: Lukas Wunner <lukas@wunner.de>
drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c