diff mbox series

[4.19.y-cip] drm: of: Fix double-free bug

Message ID 20200803111441.3157-1-biju.das.jz@bp.renesas.com
State Accepted
Delegated to: Pavel Machek
Headers show
Series [4.19.y-cip] drm: of: Fix double-free bug | expand

Commit Message

Biju Das Aug. 3, 2020, 11:14 a.m. UTC
commit 4ee48cc5586bf519df19894273002aa8ef7b70ad upstream.

Fix double-free bug in the error path.

Fixes: 6529007522de ("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
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 drivers/gpu/drm/drm_of.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Pavel Machek Aug. 3, 2020, 8:57 p.m. UTC | #1
Hi!

> commit 4ee48cc5586bf519df19894273002aa8ef7b70ad upstream.
> 
> Fix double-free bug in the error path.

Looks good to me. I can apply it if there are no other comments.

Best regards,
								Pavel
Nobuhiro Iwamatsu Aug. 3, 2020, 11:12 p.m. UTC | #2
Hi,

> -----Original Message-----
> From: Pavel Machek [mailto:pavel@denx.de]
> Sent: Tuesday, August 4, 2020 5:57 AM
> To: Biju Das <biju.das.jz@bp.renesas.com>
> Cc: cip-dev@lists.cip-project.org; iwamatsu nobuhiro(岩松 信洋 □SWC◯ACT)
> <nobuhiro1.iwamatsu@toshiba.co.jp>; Pavel Machek <pavel@denx.de>; Chris Paterson <chris.paterson2@renesas.com>;
> Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Subject: Re: [PATCH 4.19.y-cip] drm: of: Fix double-free bug
> 
> Hi!
> 
> > commit 4ee48cc5586bf519df19894273002aa8ef7b70ad upstream.
> >
> > Fix double-free bug in the error path.
> 
> Looks good to me. I can apply it if there are no other comments.
> 

I also think that it's not particularly a issue.

> Best regards,
> 								Pavel

Best regards,
  Nobuhiro

> --
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#5084): https://lists.cip-project.org/g/cip-dev/message/5084
Mute This Topic: https://lists.cip-project.org/mt/75963411/4520428
Group Owner: cip-dev+owner@lists.cip-project.org
Unsubscribe: https://lists.cip-project.org/g/cip-dev/leave/8129116/1171672734/xyzzy  [patchwork-cip-dev@patchwork.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-
Pavel Machek Aug. 4, 2020, 7:51 a.m. UTC | #3
Hi!

> > > commit 4ee48cc5586bf519df19894273002aa8ef7b70ad upstream.
> > >
> > > Fix double-free bug in the error path.
> > 
> > Looks good to me. I can apply it if there are no other comments.
> > 
> 
> I also think that it's not particularly a issue.

Thanks, applied and pushed out.

Best regards,
								Pavel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c
index 4f0bc1363fbe..f2e7f953cc93 100644
--- a/drivers/gpu/drm/drm_of.c
+++ b/drivers/gpu/drm/drm_of.c
@@ -323,10 +323,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;