aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <[email protected]>2020-12-04 13:07:41 +0200
committerLaurent Pinchart <[email protected]>2021-01-05 07:19:59 +0200
commit594f967b53ffafd50c5f091f434c4a07e2d0f613 (patch)
tree81d28b54bc618942cd07e71f97966d8443784ff4
parent53ced169373aab52d3b5da0fee6a342002d1876d (diff)
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 <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Reviewed-by: Kieran Bingham <[email protected]>
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_vsp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
index f6a69aa116e6..4dcb1bfbe201 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
@@ -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;