drm: rcar-du: Release vsp device reference in all error paths

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>
This commit is contained in:
Laurent Pinchart 2020-12-04 13:07:41 +02:00
parent 53ced16937
commit 594f967b53
1 changed files with 1 additions and 1 deletions

View 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;