dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/bridge: adv7511: Fix a use after free
@ 2017-10-17 20:43 Dan Carpenter
  2017-10-18  4:13 ` Archit Taneja
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-10-17 20:43 UTC (permalink / raw)
  To: Archit Taneja
  Cc: Neil Armstrong, Daniel Vetter, kernel-janitors, dri-devel,
	Laurent Pinchart, Hans Verkuil, Bhumika Goyal

We free "edid", then use it again on the next line.

Fixes: 3b1b975003e4 ("drm: adv7511/33: add HDMI CEC support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
index 31ca883bda83..0e14f1572d05 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
@@ -607,10 +607,10 @@ static int adv7511_get_modes(struct adv7511 *adv7511,
 	adv7511_set_config_csc(adv7511, connector, adv7511->rgb,
 			       drm_detect_hdmi_monitor(edid));
 
-	kfree(edid);
-
 	cec_s_phys_addr_from_edid(adv7511->cec_adap, edid);
 
+	kfree(edid);
+
 	return count;
 }
 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-18  4:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-17 20:43 [PATCH] drm/bridge: adv7511: Fix a use after free Dan Carpenter
2017-10-18  4:13 ` Archit Taneja

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox