]> git.baikalelectronics.ru Git - kernel.git/commit
drm: move lease init after validation in drm_lease_create
authorKeith Packard <keithp@keithp.com>
Thu, 21 Dec 2017 06:54:24 +0000 (22:54 -0800)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 21 Dec 2017 08:49:40 +0000 (09:49 +0100)
commit279769e3bef92796009ee2922c01105c1c1f7663
tree9a722b300870bd111d323e2131dd0aca6715d851
parent3f70f82ea32414c3addd5c588794c0f4fc6b0e22
drm: move lease init after validation in drm_lease_create

Patch 9b34f6418ad7a1f124669e41371df452afddbd17 fixed a deadlock in the
failure path of drm_lease_create. This made the partially initialized
lease object visible for a short window of time.

To avoid having the lessee state appear transiently, I've rearranged
the code so that the lessor fields are not filled in until the
parameters are all validated and the function will succeed.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20171221065424.1304-1-keithp@keithp.com
drivers/gpu/drm/drm_lease.c