[PATCH] drm: rcar-du: Fix memory leak in rcar_du_vsps_init()

Biju Das biju.das.jz at bp.renesas.com
Wed Nov 15 15:09:32 UTC 2023


The rcar_du_vsps_init() doesn't free the np allocated by
of_parse_phandle_with_fixed_args() for the non-error case.

Fix memory leak for the non-error case.

Fixes: 3e81374e2014 ("drm: rcar-du: Support multiple sources from the same VSP")
Signed-off-by: Biju Das <biju.das.jz at bp.renesas.com>
---
 drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
index 70d8ad065bfa..5cd54ea33313 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
@@ -747,8 +747,6 @@ static int rcar_du_vsps_init(struct rcar_du_device *rcdu)
 			goto error;
 	}
 
-	return 0;
-
 error:
 	for (i = 0; i < ARRAY_SIZE(vsps); ++i)
 		of_node_put(vsps[i].np);
-- 
2.25.1



More information about the dri-devel mailing list