]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit7361d062ecb9b11f0f33ed2825ef13f2e25cdbcc
tree33f0ff43bfbc5aca951546e5e2a294c24e202d79
parent5ac7ed67943c9ca7960b6d1fb943751068f7a1bb
drm: Clear state->acquire_ctx before leaving drm_atomic_helper_commit_duplicated_state()

BugLink: https://bugs.launchpad.net/bugs/1837664
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/gpu/drm/drm_atomic_helper.c