]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm: rcar-du: Release vsp device reference in all error paths
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Fri, 4 Dec 2020 11:07:41 +0000 (13:07 +0200)
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tue, 5 Jan 2021 05:19:59 +0000 (07:19 +0200)
Use drmm_add_action_or_reset() instead of drmm_add_action() to ensure
the vsp device reference is released in case the function call fails.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
drivers/gpu/drm/rcar-du/rcar_du_vsp.c

index f6a69aa116e6cc704628c69c743fe497b9030ddf..4dcb1bfbe201816940ba08526c193ea8c0e21a67 100644 (file)
@@ -364,7 +364,7 @@ int rcar_du_vsp_init(struct rcar_du_vsp *vsp, struct device_node *np,
 
        vsp->vsp = &pdev->dev;
 
-       ret = drmm_add_action(rcdu->ddev, rcar_du_vsp_cleanup, vsp);
+       ret = drmm_add_action_or_reset(rcdu->ddev, rcar_du_vsp_cleanup, vsp);
        if (ret < 0)
                return ret;