]> 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)
commit28278bb30997969077ea2bc9423b9fce138f513e
treef5508c1cf472149239011c514789cde6788390fc
parent910837ff3090764d86bfbb72af26b269774f48de
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