Commit cfb3f1cd authored by Mateusz Kulikowski's avatar Mateusz Kulikowski Committed by Marek Vasut

usb: ehci-hcd: Fix crash when no ops are provided to ehci_register()

This commit fixes crash on BananaPi (and possibly others)
casued by 3f9f8a5b.

Crash reason:
When no ops were passed to ehci_register(), USB host driver caused
NULL pointer dereference.
Signed-off-by: default avatarMateusz Kulikowski <>
parent ac7eef71
......@@ -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;
Markdown is supported
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