aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb
diff options
context:
space:
mode:
authorFelipe Balbi <felipe.balbi@nokia.com>2010-01-21 08:33:57 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-02 17:54:43 -0500
commitda5108e1a350c84b185b5f11aa58fea93a204fe0 (patch)
tree8b6b791845044998e540a5e7795139bfe99014f3 /drivers/usb/musb
parent3d268645d50989bc874fadf20db6fd6d17b380dc (diff)
USB: musb: unmap base if we can't probe
when probe() fails, we should iounmap() the mapped address. Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r--drivers/usb/musb/musb_core.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 3e9b3b0e9c0d..de7b3770f6ee 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2110,6 +2110,7 @@ static int __init musb_probe(struct platform_device *pdev)
2110{ 2110{
2111 struct device *dev = &pdev->dev; 2111 struct device *dev = &pdev->dev;
2112 int irq = platform_get_irq(pdev, 0); 2112 int irq = platform_get_irq(pdev, 0);
2113 int status;
2113 struct resource *iomem; 2114 struct resource *iomem;
2114 void __iomem *base; 2115 void __iomem *base;
2115 2116
@@ -2127,7 +2128,12 @@ static int __init musb_probe(struct platform_device *pdev)
2127 /* clobbered by use_dma=n */ 2128 /* clobbered by use_dma=n */
2128 orig_dma_mask = dev->dma_mask; 2129 orig_dma_mask = dev->dma_mask;
2129#endif 2130#endif
2130 return musb_init_controller(dev, irq, base); 2131
2132 status = musb_init_controller(dev, irq, base);
2133 if (status < 0)
2134 iounmap(base);
2135
2136 return status;
2131} 2137}
2132 2138
2133static int __exit musb_remove(struct platform_device *pdev) 2139static int __exit musb_remove(struct platform_device *pdev)