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
@ -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…
Reference in New Issue
Block a user