]> git.baikalelectronics.ru Git - kernel.git/commit
drm/atomic: Fix memleak on ERESTARTSYS during non-blocking commits
authorLeo (Sunpeng) Li <sunpeng.li@amd.com>
Thu, 4 Jan 2018 19:47:33 +0000 (14:47 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 9 Jan 2018 17:07:00 +0000 (12:07 -0500)
commit7069afc3d9d74b0f49addadf73afc0b809a9cc76
tree4ef9044f02dafe498ddb609cbaac1d6e6dd4a5ca
parenta9d11c30a0341c16d4a293849063611c6b9b0950
drm/atomic: Fix memleak on ERESTARTSYS during non-blocking commits

During a non-blocking commit, it is possible to return before the
commit_tail work is queued (-ERESTARTSYS, for example).

Since a reference on the crtc commit object is obtained for the pending
vblank event when preparing the commit, the above situation will leave
us with an extra reference.

Therefore, if the commit_tail worker has not consumed the event at the
end of a commit, release it's reference.

Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1515095253-29817-1-git-send-email-sunpeng.li@amd.com
drivers/gpu/drm/drm_atomic_helper.c