drm/gem-atomic-helper: fix explicit fence leak without a framebuffer
Subsystems (2)
PATCH 1/1 drm/gem-atomic-helper: fix explicit fence leak without a framebuffer
drm_gem_plane_helper_prepare_fb() takes a reference on state->fence before checking whether the plane state has a framebuffer. An explicit fence can be attached to a disabled plane through the IN_FENCE_FD property, and drm_atomic_plane_check() accepts that state because CRTC and framebuffer are both unset. The early return for the missing framebuffer then drops the newly acquired reference without releasing it.
Move the reference acquisition after the framebuffer check.
--- drivers/gpu/drm/drm_gem_atomic_helper.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_gem_atomic_helper.c +3 -1
@@ -114,7 +114,7 @@int drm_gem_plane_helper_prepare_fb (struct drm_plane *plane,struct drm_plane_state *state) { -struct dma_fence *fence =dma_fence_get (state->fence); +struct dma_fence *fence;enum dma_resv_usage usage;size_t i;int ret;
@@ -122,6 +122,8 @@ int drm_gem_plane_helper_prepare_fb(struct drm_plane *plane,if (!state->fb)return 0 ; + fence =dma_fence_get (state->fence); +/* * Only add the kernel fences here if there is already a fence set via * explicit fencing interfaces on the atomic ioctl.
Signature · 1 line
2.34.1
Quoted 10 lines · Wentao Liang
drm_gem_plane_helper_prepare_fb()takes a reference onstate->fencebefore checking whether the plane state has a framebuffer. An explicit fence can be attached to a disabled plane through theIN_FENCE_FDproperty, anddrm_atomic_plane_check()accepts that state because CRTC and framebuffer are both unset. The early return for the missing framebuffer then drops the newly acquired reference without releasing it.Move the reference acquisition after the framebuffer check.
Quoted 8 lines
Fixes 1ea28bc5542d ("drm: handle kernel fences in drm_gem_plane_helper_prepare_fb v2")Assisted-by DeepSeek-V4.1-Flash and OpenAI CodexSigned-off-by Wentao Liang <[email protected]>--- drivers/gpu/drm/drm_gem_atomic_helper.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Multiple things here:
1. Your team ignored completely previous feedback. Multiple times.
2. You use multiple identities with this email address, thus I doubt that we speak with an actual person.
3. Your bot does not even bother running checkpatch, right?
4. Nothing of this was reproduced nor tested.
5. Finally, the same feedback:
You sent multiple independent patches, to multiple independent subsystems. The amount of these patches clearly suggest this was AI generated and most likely not tested.
More importantly, you sent all this work without properly organizing relevant patches into patchsets. This makes reviewing difficult and might cause multiple reviewers to address the same issue. Replying to the entire set is impossible and requires handling each patch independently, instead of applying or discarding the set. Maintainers also won't see the bigger picture of your work. Quite worrying.
This is on the verge of hostile patch: bomb us with so many contributions, we won't be able to handle them in efficient manner, like responding ONCE to ask you to slow down. Considering all this is untested and LLM generated, I have even more doubts whether this should be considered for review.
Please read kernel documentation BEFORE posting more work. It will explain you how to identify subsystems, how to organize your work per subsystem (so a patchset grouping multiple patches with a short cover letter), how to document the issue discovery method and what was or was not tested.
Best regards,
Krzysztof