[PATCH] drm/rockchip: Balance irq refcount on failure

Daniel Kurtz djkurtz at chromium.org
Mon Sep 19 04:18:23 UTC 2016


On Sat, Sep 17, 2016 at 2:22 AM, Sean Paul <seanpaul at chromium.org> wrote:
> If create_crtc fails in vop bind, ensure the irq refcount is zeroed
> back out before exiting.
>
> Signed-off-by: Sean Paul <seanpaul at chromium.org>

Reviewed-by: Daniel Kurtz <djkurtz at chromium.org>

> ---
>  drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> index 57650c9..131ae0f 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> @@ -1551,11 +1551,15 @@ static int vop_bind(struct device *dev, struct device *master, void *data)
>
>         ret = vop_create_crtc(vop);
>         if (ret)
> -               return ret;
> +               goto err_enable_irq;
>
>         pm_runtime_enable(&pdev->dev);
>
>         return 0;
> +
> +err_enable_irq:
> +       enable_irq(vop->irq); /* To balance out the disable_irq above */
> +       return ret;
>  }
>
>  static void vop_unbind(struct device *dev, struct device *master, void *data)
> --
> 2.8.0.rc3.226.g39d4020
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel


More information about the dri-devel mailing list