Skip to content

Commit

Permalink
usb: musb: dsps: fix iounmap in error and exit paths
Browse files Browse the repository at this point in the history
Cleanly iounmap the pointer in error and exit paths.

Signed-off-by: Bin Liu <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Bin Liu authored and gregkh committed Mar 14, 2017
1 parent 0090114 commit 6b7ad49
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/usb/musb/musb_dsps.c
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ static int dsps_probe(struct platform_device *pdev)
if (usb_get_dr_mode(&pdev->dev) == USB_DR_MODE_PERIPHERAL) {
ret = dsps_setup_optional_vbus_irq(pdev, glue);
if (ret)
return ret;
goto err_iounmap;
}

platform_set_drvdata(pdev, glue);
Expand All @@ -946,6 +946,8 @@ static int dsps_probe(struct platform_device *pdev)

err:
pm_runtime_disable(&pdev->dev);
err_iounmap:
iounmap(glue->usbss_base);
return ret;
}

Expand All @@ -956,6 +958,7 @@ static int dsps_remove(struct platform_device *pdev)
platform_device_unregister(glue->musb);

pm_runtime_disable(&pdev->dev);
iounmap(glue->usbss_base);

return 0;
}
Expand Down

0 comments on commit 6b7ad49

Please sign in to comment.