]> git.baikalelectronics.ru Git - kernel.git/commit
drm/vmwgfx: Fix a layout race condition
authorThomas Hellstrom <thellstrom@vmware.com>
Mon, 12 Nov 2018 14:46:39 +0000 (15:46 +0100)
committerThomas Hellstrom <thellstrom@vmware.com>
Wed, 5 Dec 2018 09:08:53 +0000 (10:08 +0100)
commitfdbd577065e25eabe951ec316ef817c3ff257e2c
treef5508c1cf472149239011c514789cde6788390fc
parent3dc284a19db36f6cb7b1d53943319e3d5fef644f
drm/vmwgfx: Fix a layout race condition

This fixes a layout update race condition. We make sure
the crtc mutex is locked before we dereference crtc->state. Otherwise the
state might change under us.

Since now we're already holding the crtc mutexes when reading the gui
coordinates, protect them with the crtc mutexes rather than with the
requested_layout mutex.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Deepak Rawat <drawat@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c