]> git.karo-electronics.de Git - linux-beck.git/commitdiff
USB: ohci-exynos: Add missing usb_put_hcd() to prevent memory leak
authorJingoo Han <jg1.han@samsung.com>
Thu, 10 Oct 2013 01:02:38 +0000 (10:02 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Oct 2013 23:31:15 +0000 (16:31 -0700)
When devm_usb_get_phy() fails, usb_put_hcd() should be called
to prevent memory leak.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ohci-exynos.c

index f5f372e02a990544ee8fa1f5c08841b06cd206d4..122e52e88a401e0e20f524871689a4d3da7e5238 100644 (file)
@@ -100,6 +100,7 @@ static int exynos_ohci_probe(struct platform_device *pdev)
        if (IS_ERR(phy)) {
                /* Fallback to pdata */
                if (!pdata) {
+                       usb_put_hcd(hcd);
                        dev_warn(&pdev->dev, "no platform data or transceiver defined\n");
                        return -EPROBE_DEFER;
                } else {