usb: ehci-s5p: fix memleak when fallback to pdata
authorLibo Chen <chenlibo.3@gmail.com>
Thu, 9 May 2013 04:58:08 +0000 (12:58 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 May 2013 00:35:13 +0000 (17:35 -0700)
When devm_usb_get_phy fail, we should free hcd

Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-s5p.c

index a81465e..379037f 100644 (file)
@@ -105,6 +105,7 @@ static int s5p_ehci_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 {