drm/bridge: adv7511: Fix a use after free
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 17 Oct 2017 20:43:43 +0000 (23:43 +0300)
committerArchit Taneja <architt@codeaurora.org>
Wed, 18 Oct 2017 04:08:43 +0000 (09:38 +0530)
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>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20171017204343.zctliubjkq7imudi@mwanda
drivers/gpu/drm/bridge/adv7511/adv7511_drv.c

index 31ca883bda83dc95a677fd4d846172df5c976bd4..0e14f1572d0593452d494a75dd712f7fb194d740 100644 (file)
@@ -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;
 }