]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/usb/host/ehci-ppc-of.c
USB: ehci-ppc-of: problems in unwind
[karo-tx-linux.git] / drivers / usb / host / ehci-ppc-of.c
index 5aec92866ab3e1398ac4450ec62f9d9dfe9c195c..a07cfd6d593b9f84e34eefba7887cc4f111dafc3 100644 (file)
@@ -192,17 +192,19 @@ ehci_hcd_ppc_of_probe(struct of_device *op, const struct of_device_id *match)
        }
 
        rv = usb_add_hcd(hcd, irq, 0);
-       if (rv == 0)
-               return 0;
+       if (rv)
+               goto err_ehci;
+
+       return 0;
 
+err_ehci:
+       if (ehci->has_amcc_usb23)
+               iounmap(ehci->ohci_hcctrl_reg);
        iounmap(hcd->regs);
 err_ioremap:
        irq_dispose_mapping(irq);
 err_irq:
        release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
-
-       if (ehci->has_amcc_usb23)
-               iounmap(ehci->ohci_hcctrl_reg);
 err_rmr:
        usb_put_hcd(hcd);