Skip to content

Commit

Permalink
USB: musb: unmap base if we can't probe
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Felipe Balbi authored and Greg Kroah-Hartman committed Mar 2, 2010
1 parent 3d26864 commit da5108e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/usb/musb/musb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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)
Expand Down

0 comments on commit da5108e

Please sign in to comment.