drm: Clear state->acquire_ctx before leaving drm_atomic_helper_commit_duplicated_state()
authorSean Paul <seanpaul@chromium.org>
Thu, 29 Nov 2018 15:04:14 +0000 (10:04 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 18:46:00 +0000 (19:46 +0100)
commite6ee8bfc97c23a368b2d22d5a2abdc2b29109593
tree50dc2637c9a379d0e4be7a193f1cc212d34566d1
parent51d0d8e65de67e6a2695aeae325f0af63041de4e
drm: Clear state->acquire_ctx before leaving drm_atomic_helper_commit_duplicated_state()

[ Upstream commit aa394b0dd68cb00c483e151dcd84713d4d517ed1 ]

drm_atomic_helper_commit_duplicated_state() sets state->acquire_ctx to
the context given in the argument and leaves it in state after it
quits. The lifetime of state and context are not guaranteed to be the
same, so we shouldn't leave that pointer hanging around. This patch
resets the context to NULL to avoid any oopses.

Changes in v2:
- Added to the set

Suggested-by: Daniel Vetter <daniel@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20181129150423.239081-1-sean@poorly.run
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/drm_atomic_helper.c