drm/bridge: tc358767: fix EDID memory leak
Subsystems (3)
PATCH 1/1 drm/bridge: tc358767: fix EDID memory leak
The current EDID allocated with drm_get_edid() is freed when the driver gets a new EDID, but it is not freed when the driver is removed, causing a leak.
Free the EDID (if any) on driver remove.
--- drivers/gpu/drm/bridge/tc358767.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/bridge/tc358767.c +2 -0
@@ -1695,6 +1695,8 @@ static int tc_remove(struct i2c_client *client)drm_bridge_remove (&tc->bridge);drm_dp_aux_unregister (&tc->aux); +kfree (tc->edid); +return 0 ; }
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
Quoted 7 lines · Tomi Valkeinen
The current EDID allocated with
drm_get_edid()is freed when the driver gets a new EDID, but it is not freed when the driver is removed, causing a leak.Free the EDID (if any) on driver remove.
Signed-off-by Tomi Valkeinen <[email protected]>
Regards
Andrzej
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Laurent Pinchart
reviewerHi Tomi,
Thank you for the patch.
Quoted 16 lines · Tomi Valkeinen
The current EDID allocated with
drm_get_edid()is freed when the driver gets a new EDID, but it is not freed when the driver is removed, causing a leak.Free the EDID (if any) on driver remove.
Signed-off-by Tomi Valkeinen <[email protected]>--- drivers/gpu/drm/bridge/tc358767.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/bridge/tc358767.c +0
-0
drivers/gpu/drm/bridge/tc358767.c static int tc_remove(struct i2c_client *client) · line 1699
Quoted 5 lines
drivers/gpu/drm/bridge/tc358767.c +2
-0@@ -1695,6 +1695,8 @@ static int tc_remove(struct i2c_client *client)drm_bridge_remove (&tc->bridge);drm_dp_aux_unregister (&tc->aux); +kfree (tc->edid); +
tc->edid is gone in drm-misc-next, problem solved already :-)
Quoted 2 lines
drivers/gpu/drm/bridge/tc358767.c +0
-0return 0 ; }
Signature · 7 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 24 lines · Laurent Pinchart
Hi Tomi,
Thank you for the patch.
Quoted 19 lines · Tomi Valkeinen
The current EDID allocated with
drm_get_edid()is freed when the driver gets a new EDID, but it is not freed when the driver is removed, causing a leak.Free the EDID (if any) on driver remove.
Signed-off-by Tomi Valkeinen <[email protected]>--- drivers/gpu/drm/bridge/tc358767.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/bridge/tc358767.c +0
-0@@ -1695,6 +1695,8 @@ static int tc_remove(struct i2c_client *client)drm_bridge_remove (&tc->bridge);drm_dp_aux_unregister (&tc->aux);
Quoted 4 lines
drivers/gpu/drm/bridge/tc358767.c static int tc_remove(struct i2c_client *client) · line 1699
Quoted 2 lines
drivers/gpu/drm/bridge/tc358767.c +2
-0+kfree (tc->edid); +
tc->edidis gone in drm-misc-next, problem solved already :-)
Well, indeed. Should have looked at the latest... =). The leak only happens on driver remove, so I don't think it's worth sending for stable kernels.
Tomi
Signature · 6 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