UPSTREAM: drm: of: Fix double-free bug

Fix double-free bug in the error path.

Fixes: 6529007522 ("drm: of: Add drm_of_lvds_get_dual_link_pixel_order")
Reported-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1595502654-40595-1-git-send-email-biju.das.jz@bp.renesas.com
(cherry picked from commit 4ee48cc558)
Change-Id: I9dcf69801d75592bc6e721b40734cb766a29366c
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
This commit is contained in:
Biju Das 2020-07-23 12:10:54 +01:00 committed by Tao Huang
parent 24713d8860
commit 4505520aed

View File

@ -328,10 +328,8 @@ static int drm_of_lvds_get_remote_pixels_type(
* configurations by passing the endpoints explicitly to
* drm_of_lvds_get_dual_link_pixel_order().
*/
if (!current_pt || pixels_type != current_pt) {
of_node_put(remote_port);
if (!current_pt || pixels_type != current_pt)
return -EINVAL;
}
}
return pixels_type;