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

* Re: [PATCH] drm/bridge: adv7511: Fix a use after free
  2017-10-17 20:43 [PATCH] drm/bridge: adv7511: Fix a use after free Dan Carpenter
@ 2017-10-18  4:13 ` Archit Taneja
  0 siblings, 0 replies; 2+ messages in thread
From: Archit Taneja @ 2017-10-18  4:13 UTC (permalink / raw)
  To: Dan Carpenter, Hans Verkuil
  Cc: Andrzej Hajda, Laurent Pinchart, David Airlie, John Stultz,
	Lars-Peter Clausen, Neil Armstrong, Bhumika Goyal, Daniel Vetter,
	Inki Dae, dri-devel, kernel-janitors



On 10/18/2017 02:13 AM, Dan Carpenter wrote:
> 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>

Thanks for the fix. I've queued this to drm-misc-next.

Archit

> 
> 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;
>   }
>   
> 

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[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