Skip to contentSkip to conversation

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

PATCH New Mateusz Kulikowski 3 participants 3 messages Apr 3, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

 drivers/usb/host/ehci-hcd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/host/ehci-hcd.c +2 -2
index 598f444..fa5d584 100644
@@ -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;
 	}
Signature · 1 line
2.5.0
#1 lore raw

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

Quoted 9 lines

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.

---

Confirmed working for Banana Pi, both on top of 3f9f8a5 and when applied to current master (563d8d9).

Regards, B. Nortmann

Applied
#2 lore raw

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

In reply to Mateusz Kulikowski
Quoted 8 lines · Mateusz Kulikowski

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.

Applied, thanks!

Best regards,
Marek Vasut