drm/omap: fix use of freed memory
Subsystems (3)
PATCH 1/1 drm/omap: fix use of freed memory
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
--- drivers/gpu/drm/omapdrm/omap_connector.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/omapdrm/omap_connector.c +2 -1
@@ -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
Signature · 7 lines
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Tomi,
Thank you for the patch.
Quoted 11 lines · On Wednesday, 26 September 2018 13:05:59 EEST Tomi Valkeinen wrote:
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
949ea2ef3fed4e1d0f9b80ec21ed81a9833ac248Signed-off-by Tomi Valkeinen <[email protected]>
Sorry for introducing the bug in the first place.
Quoted 23 lines
--- drivers/gpu/drm/omapdrm/omap_connector.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/gpu/drm/omapdrm/omap_connector.cindex98f5ca29444a..b81302c4bf9e100644drivers/gpu/drm/omapdrm/omap_connector.c +2
-1@@ -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_EDID512
Signature · 10 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel