On Wed, Mar 08, 2017 at 10:24:31AM -0600, Bin Liu wrote:
> Cleanly iounmap the pointer in error and exit paths.
> 
> Signed-off-by: Bin Liu <[email protected]>
> ---
>  drivers/usb/musb/musb_dsps.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
> index 7c047c4a2565..c84f32d0dd4d 100644
> --- a/drivers/usb/musb/musb_dsps.c
> +++ b/drivers/usb/musb/musb_dsps.c
> @@ -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 err1;
>       }
>  
>       platform_set_drvdata(pdev, glue);
> @@ -946,6 +946,8 @@ static int dsps_probe(struct platform_device *pdev)
>  
>  err:
>       pm_runtime_disable(&pdev->dev);
> +err1:

I suggest you use

        err_iounmap:
        
here instead (as per the coding standard too).

> +     iounmap(glue->usbss_base);
>       return ret;
>  }

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to