]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: octeon-usb: use correct function for hcd cleanup
authorAnton Bondarenko <anton.bondarenko.sama@gmail.com>
Mon, 8 May 2017 23:33:15 +0000 (01:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 May 2017 05:43:55 +0000 (07:43 +0200)
Use usb_put_hdc to release hdc allocated by usb_create_hcd.
This is needed to handle sub-allocations and HCD sharing correctly.

Signed-off-by: Anton Bondarenko <anton.bondarenko.sama@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/octeon-usb/octeon-hcd.c

index 9a7858a300fd76dbb4c6b73d6143d6018b46d8d8..068aece25d37f17414a3767b79fc8510cdf6bb3e 100644 (file)
@@ -3659,14 +3659,14 @@ static int octeon_usb_probe(struct platform_device *pdev)
        status = cvmx_usb_initialize(dev, usb);
        if (status) {
                dev_dbg(dev, "USB initialization failed with %d\n", status);
-               kfree(hcd);
+               usb_put_hcd(hcd);
                return -1;
        }
 
        status = usb_add_hcd(hcd, irq, 0);
        if (status) {
                dev_dbg(dev, "USB add HCD failed with %d\n", status);
-               kfree(hcd);
+               usb_put_hcd(hcd);
                return -1;
        }
        device_wakeup_enable(hcd->self.controller);
@@ -3691,7 +3691,7 @@ static int octeon_usb_remove(struct platform_device *pdev)
        if (status)
                dev_dbg(dev, "USB shutdown failed with %d\n", status);
 
-       kfree(hcd);
+       usb_put_hcd(hcd);
 
        return 0;
 }