diff mbox

[V2,4/5] USB: ohci-exynos: Add missing usb_put_hcd()

Message ID 000501cec58c$41590750$c40b15f0$%han@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jingoo Han Oct. 10, 2013, 7:42 a.m. UTC
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>
---
 drivers/usb/host/ohci-exynos.c |    1 +
 1 file changed, 1 insertion(+)

Comments

Greg KH Oct. 11, 2013, 11:55 p.m. UTC | #1
On Thu, Oct 10, 2013 at 04:42:22PM +0900, Jingoo Han wrote:
> 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>

Already applied this one, thanks.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index 5c877bf..aa50e18 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -91,6 +91,7 @@  static int exynos_ohci_probe(struct platform_device *pdev)
 
 	phy = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
 	if (IS_ERR(phy)) {
+		usb_put_hcd(hcd);
 		dev_warn(&pdev->dev, "no platform data or transceiver defined\n");
 		return -EPROBE_DEFER;
 	} else {