[PATCH] USB: ohci-exynos: Add missing usb_put_hcd() to prevent memory leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When devm_usb_get_phy() fails, usb_put_hcd() should be called
to prevent memory leak.

Signed-off-by: Jingoo Han <jg1.han@xxxxxxxxxxx>
---
 drivers/usb/host/ohci-exynos.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index f5f372e..122e52e 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -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 {
-- 
1.7.10.4


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux