diff options
author | Felipe Balbi <felipe.balbi@nokia.com> | 2010-01-21 15:33:57 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-02 14:54:43 -0800 |
commit | da5108e1a350c84b185b5f11aa58fea93a204fe0 (patch) | |
tree | 8b6b791845044998e540a5e7795139bfe99014f3 /drivers/usb/musb | |
parent | 3d268645d50989bc874fadf20db6fd6d17b380dc (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.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 3e9b3b0e9c0..de7b3770f6e 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) { struct device *dev = &pdev->dev; int irq = platform_get_irq(pdev, 0); + int status; struct resource *iomem; void __iomem *base; @@ -2127,7 +2128,12 @@ static int __init musb_probe(struct platform_device *pdev) /* clobbered by use_dma=n */ orig_dma_mask = dev->dma_mask; #endif - return musb_init_controller(dev, irq, base); + + status = musb_init_controller(dev, irq, base); + if (status < 0) + iounmap(base); + + return status; } static int __exit musb_remove(struct platform_device *pdev) |