Skip to contentSkip to conversation

drm/msm/mdp5: Don't leak some plane state

PATCH Applied Daniel Vetter 4 participants 5 messages Aug 3, 2023 – Aug 4, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/msm/mdp5: Don't leak some plane state

Apparently no one noticed that mdp5 plane states leak like a sieve ever since we introduced plane_state->commit refcount a few years ago in 21a01abbe32a ("drm/atomic: Fix freeing connector/plane state too early by tracking commits, v3.")

Fix it by using the right helpers.

Fixes 21a01abbe32a ("drm/atomic: Fix freeing connector/plane state too early by tracking commits, v3.")
Cc Maarten Lankhorst <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Rob Clark <[email protected]>
Cc Abhinav Kumar <[email protected]>
Cc Dmitry Baryshkov <[email protected]>
Reported-and-tested-by [email protected]
---
 drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +1 -2
index bd2c4ac45601..0d5ff03cb091 100644
@@ -130,8 +130,7 @@ static void mdp5_plane_destroy_state(struct drm_plane *plane,
 {
 	struct mdp5_plane_state *pstate = to_mdp5_plane_state(state);
 
-	if (state->fb)
-		drm_framebuffer_put(state->fb);
+	__drm_atomic_helper_plane_destroy_state(state);
 
 	kfree(pstate);
 }
Signature · 1 line
2.40.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Daniel Vetter

Apparently no one noticed that mdp5 plane states leak like a sieve ever since we introduced plane_state->commit refcount a few years ago in 21a01abbe32a ("drm/atomic: Fix freeing connector/plane state too early by tracking commits, v3.")

Fix it by using the right helpers.

Quoted 11 lines
Fixes 21a01abbe32a ("drm/atomic: Fix freeing connector/plane state too early by tracking commits, v3.")
Cc Maarten Lankhorst <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Rob Clark <[email protected]>
Cc Abhinav Kumar <[email protected]>
Cc Dmitry Baryshkov <[email protected]>
Reported-and-tested-by [email protected]
Quoted 21 lines
---
 drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +1 -3
index bd2c4ac45601..0d5ff03cb091 100644
@@ -130,8 +130,7 @@ static void mdp5_plane_destroy_state(struct drm_plane *plane,
 {
        struct mdp5_plane_state *pstate = to_mdp5_plane_state(state);
 
-       if (state->fb)
-               drm_framebuffer_put(state->fb);
+       __drm_atomic_helper_plane_destroy_state(state);
 
        kfree(pstate);
 }
--

2.40.1

Reviewed-by on v1 1/1
#2 lore raw
In reply to Daniel Vetter
Quoted 19 lines · Daniel Vetter

Apparently no one noticed that mdp5 plane states leak like a sieve ever since we introduced plane_state->commit refcount a few years ago in 21a01abbe32a ("drm/atomic: Fix freeing connector/plane state too early by tracking commits, v3.")

Fix it by using the right helpers.

Fixes 21a01abbe32a ("drm/atomic: Fix freeing connector/plane state too early by tracking commits, v3.")
Cc Maarten Lankhorst <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Rob Clark <[email protected]>
Cc Abhinav Kumar <[email protected]>
Cc Dmitry Baryshkov <[email protected]>
Reported-and-tested-by [email protected]
Quoted 3 lines
---
 drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Signature · 2 lines
With best wishes
Dmitry
Reviewed-by on v1 1/1
#3 lore raw
In reply to Daniel Vetter
Quoted 18 lines · Daniel Vetter

Apparently no one noticed that mdp5 plane states leak like a sieve ever since we introduced plane_state->commit refcount a few years ago in 21a01abbe32a ("drm/atomic: Fix freeing connector/plane state too early by tracking commits, v3.")

Fix it by using the right helpers.

Fixes 21a01abbe32a ("drm/atomic: Fix freeing connector/plane state too early by tracking commits, v3.")
Cc Maarten Lankhorst <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Rob Clark <[email protected]>
Cc Abhinav Kumar <[email protected]>
Cc Dmitry Baryshkov <[email protected]>
Reported-and-tested-by [email protected]
Quoted 4 lines
---
  drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
#4 lore raw
In reply to Daniel Vetter
Quoted 8 lines · Daniel Vetter

Apparently no one noticed that mdp5 plane states leak like a sieve ever since we introduced plane_state->commit refcount a few years ago in 21a01abbe32a ("drm/atomic: Fix freeing connector/plane state too early by tracking commits, v3.")

Fix it by using the right helpers.

[...]

Applied, thanks!

[1/1] drm/msm/mdp5: Don't leak some plane state

      https://gitlab.freedesktop.org/lumag/msm/-/commit/fd0ad3b2365c

Best regards,

Signature · 1 line
Dmitry Baryshkov <[email protected]>