mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2026-03-14 21:10:27 +01:00
usb: ehci-hcd: Fix crash when no ops are provided to ehci_register()
This commit fixes crash on BananaPi (and possibly others)
casued by 3f9f8a5b83.
Crash reason:
When no ops were passed to ehci_register(), USB host driver caused
NULL pointer dereference.
Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
This commit is contained in:
parent
ac7eef716e
commit
cfb3f1cd0e
1 changed files with 2 additions and 2 deletions
|
|
@ -1615,8 +1615,8 @@ int ehci_register(struct udevice *dev, struct ehci_hccr *hccr,
|
|||
if (ret)
|
||||
goto err;
|
||||
|
||||
if (ops->init_after_reset) {
|
||||
ret = ops->init_after_reset(ctrl);
|
||||
if (ctrl->ops.init_after_reset) {
|
||||
ret = ctrl->ops.init_after_reset(ctrl);
|
||||
if (ret)
|
||||
goto err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue