From: Libo Chen Date: Thu, 9 May 2013 04:58:08 +0000 (+0800) Subject: usb: ehci-s5p: fix memleak when fallback to pdata X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=9a9ef7360e601cbe4c978742c115645e67bd6e25;p=linux-edison.git usb: ehci-s5p: fix memleak when fallback to pdata When devm_usb_get_phy fail, we should free hcd Signed-off-by: Libo Chen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c index a81465ed48d..379037f51a2 100644 --- a/drivers/usb/host/ehci-s5p.c +++ b/drivers/usb/host/ehci-s5p.c @@ -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 {