1
0
Fork 0

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>
utp
Mateusz Kulikowski 2016-04-03 13:38:26 +02:00 committed by Marek Vasut
parent ac7eef716e
commit cfb3f1cd0e
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}