]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
drm/omap: fix use of freed memory
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Wed, 26 Sep 2018 10:02:56 +0000 (13:02 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 2 Oct 2018 06:36:56 +0000 (09:36 +0300)
omap_connector_destroy() does:

kfree(omap_connector);
omapdss_device_put(omap_connector->output);
omapdss_device_put(omap_connector->display);

Fix this by moving the kfree after the omapdss_device_puts.

This bug was introduced in 949ea2ef3fed4e1d0f9b80ec21ed81a9833ac248

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
drivers/gpu/drm/omapdrm/omap_connector.c

index 98f5ca29444ace053d27015f158b9b71db903c89..b81302c4bf9e6d49a678ff8e34829b8c0bc7dbc3 100644 (file)
@@ -164,10 +164,11 @@ static void omap_connector_destroy(struct drm_connector *connector)
 
        drm_connector_unregister(connector);
        drm_connector_cleanup(connector);
-       kfree(omap_connector);
 
        omapdss_device_put(omap_connector->output);
        omapdss_device_put(omap_connector->display);
+
+       kfree(omap_connector);
 }
 
 #define MAX_EDID  512