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>
This commit is contained in:
Felipe Balbi 2010-01-21 15:33:57 +02:00 коммит произвёл Greg Kroah-Hartman
Родитель 3d268645d5
Коммит da5108e1a3
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -2110,6 +2110,7 @@ static int __init musb_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
int irq = platform_get_irq(pdev, 0); int irq = platform_get_irq(pdev, 0);
int status;
struct resource *iomem; struct resource *iomem;
void __iomem *base; void __iomem *base;
@ -2127,7 +2128,12 @@ static int __init musb_probe(struct platform_device *pdev)
/* clobbered by use_dma=n */ /* clobbered by use_dma=n */
orig_dma_mask = dev->dma_mask; orig_dma_mask = dev->dma_mask;
#endif #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) static int __exit musb_remove(struct platform_device *pdev)