From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Wed, 19 Jun 2013 15:38:14 +0000 (+0200)
Subject: usb: musb: core: call dma_controller_destroy() in the err path
X-Git-Tag: v3.12-rc1~186^2~77^2~95
X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f3ce4d5;p=linux.git

usb: musb: core: call dma_controller_destroy() in the err path

The cleanup in the error is missing the dma controller. The structure is
allocated at runtime and ux500 allocates even a little more than just
this struct. So cleanup!

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
---

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index b33bed5b0dc8..9b774e72c0e4 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1933,6 +1933,8 @@ fail4:
 	musb_gadget_cleanup(musb);
 
 fail3:
+	if (musb->dma_controller)
+		dma_controller_destroy(musb->dma_controller);
 	pm_runtime_put_sync(musb->controller);
 
 fail2: