summaryrefslogtreecommitdiff
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorMateusz Kulikowski <mateusz.kulikowski@gmail.com>2016-04-03 11:38:26 (GMT)
committerMarek Vasut <marex@denx.de>2016-04-10 15:18:42 (GMT)
commitcfb3f1cd0e022711d69ff040884357b8410865ef (patch)
tree5d04158fb6fe363c48095c659a0d74f659268cc4 /drivers/usb/host
parentac7eef716e6298feea81a927904b25efe1f492ac (diff)
downloadu-boot-cfb3f1cd0e022711d69ff040884357b8410865ef.tar.xz
usb: ehci-hcd: Fix crash when no ops are provided to ehci_register()
This commit fixes crash on BananaPi (and possibly others) casued by 3f9f8a5b83f8aec40c9f4ee496046a695e333c45. 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>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/ehci-hcd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 598f444..fa5d584 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -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;
}