A recent commit, [PATCH] Fix OMAP EHCI suspend/resume failure (i693) '354ab856' causes ehci probe to fail on omap3xxx. This exposed bugs in the ehci_hcd_omap_probe error path causing an oops. On the error path, call usb_remove_hcd if usb_add_hcd has been called, and call usb_put_hcd if usb_alloc_hcd has been called. Tested on BB-xM.
Unified · Split
| @@ -347,7 +347,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) · 346 unmodified lines | |||
| 347 | ret = usb_add_hcd(hcd, irq, IRQF_SHARED); | 347 | ret = usb_add_hcd(hcd, irq, IRQF_SHARED); |
| 348 | if (ret) { | 348 | if (ret) { |
| 349 | dev_err(dev, "failed to add hcd with err %d\n", ret); | 349 | dev_err(dev, "failed to add hcd with err %d\n", ret); |
| 350 | goto err_add_hcd; | 350 | goto err_pm_runtime; |
| 351 | } | 351 | } |
| 352 | 352 | ||
| 353 | /* root ports should always stay powered */ | 353 | /* root ports should always stay powered */ |
| @@ -424,8 +424,12 @@ err_utmi_p1_fck: · 70 unmodified lines | |||
| 424 | clk_put(utmi_p1_fck); | 424 | clk_put(utmi_p1_fck); |
| 425 | 425 | ||
| 426 | err_add_hcd: | 426 | err_add_hcd: |
| 427 | usb_remove_hcd(hcd); | ||
| 428 | |||
| 429 | err_pm_runtime: | ||
| 427 | disable_put_regulator(pdata); | 430 | disable_put_regulator(pdata); |
| 428 | pm_runtime_put_sync(dev); | 431 | pm_runtime_put_sync(dev); |
| 432 | usb_put_hcd(hcd); | ||
| 429 | 433 | ||
| 430 | err_io: | 434 | err_io: |
| 431 | iounmap(regs); | 435 | iounmap(regs); |