usb: gadget: at91_udc: add missing clk_put on fclk and iclk
authorBoris BREZILLON <b.brezillon@overkiz.com>
Fri, 2 Aug 2013 08:37:27 +0000 (10:37 +0200)
committerFelipe Balbi <balbi@ti.com>
Fri, 2 Aug 2013 12:17:02 +0000 (15:17 +0300)
This patch adds missing clk_put on fclk and iclk in case the probe function
fails after these clocks have been retrieved.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/at91_udc.c

index d237429dd93a46e8c78bfa34e7d82874789cc348..94d1d3cacce86a5df95f24bc2c25db4ab0f3d122 100644 (file)
@@ -1851,6 +1851,10 @@ fail3:
 fail2:
        free_irq(udc->udp_irq, udc);
 fail1:
+       if (!IS_ERR(udc->fclk))
+               clk_put(udc->fclk);
+       if (!IS_ERR(udc->iclk))
+               clk_put(udc->iclk);
        iounmap(udc->udp_baseaddr);
 fail0a:
        if (cpu_is_at91rm9200())