usb: musb: blackfin: call gpio_free() on error path in musb_platform_init()
authorSergei Shtylyov <sshtylyov@ru.mvista.com>
Wed, 29 Sep 2010 06:54:31 +0000 (09:54 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 22 Nov 2010 18:47:36 +0000 (10:47 -0800)
commit 00be545e49d83485d49a598d3b7e090088934be8 upstream.

Blackfin's musb_platform_init() needs to call gpio_free() for error cleanup iff
otg_get_transceiver() call returns NULL.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/musb/blackfin.c

index fcec87ea709e6d682f4c045d79c19c2c4a1fbcda..51e8f0f734a0028e0f82f78e6e29a3bde26c79d4 100644 (file)
@@ -248,8 +248,10 @@ int __init musb_platform_init(struct musb *musb)
 
        usb_nop_xceiv_register();
        musb->xceiv = otg_get_transceiver();
-       if (!musb->xceiv)
+       if (!musb->xceiv) {
+               gpio_free(musb->config->gpio_vrsel);
                return -ENODEV;
+       }
 
        if (ANOMALY_05000346) {
                bfin_write_USB_APHY_CALIB(ANOMALY_05000346_value);