drm: rcar-du: Fix memory leak in rcar_du_vsps_init()
authorBiju Das <biju.das.jz@bp.renesas.com>
Thu, 16 Nov 2023 12:24:24 +0000 (12:24 +0000)
committerTomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Fri, 2 May 2025 08:52:10 +0000 (11:52 +0300)
commit91e3bf09a90bb4340c0c3c51396e7531555efda4
tree74e4e73e243caec60d68f54c8e8e20adc9073a27
parent4f1a965d592a0ca7d4ee2125f54d19ba8292295a
drm: rcar-du: Fix memory leak in rcar_du_vsps_init()

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.

While at it, replace the label 'error'->'done' as it applies to non-error
case as well and update the error check condition for rcar_du_vsp_init()
to avoid breakage in future, if it returns positive value.

Fixes: 3e81374e2014 ("drm: rcar-du: Support multiple sources from the same VSP")
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20231116122424.80136-1-biju.das.jz@bp.renesas.com
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c