]> git.baikalelectronics.ru Git - kernel.git/commit
drm/vc4: plane: protect device resources after removal
authorDanilo Krummrich <dakr@redhat.com>
Wed, 24 Aug 2022 16:13:25 +0000 (18:13 +0200)
committerMaxime Ripard <maxime@cerno.tech>
Thu, 25 Aug 2022 07:44:25 +0000 (09:44 +0200)
commit9f51b964038a5daad82bb773c889275908637fb6
tree9e6c2a884104c512471e3f376f20f40d708939c1
parentfe5cf17f87c05d65d62b5780747d77d9d6a581b6
drm/vc4: plane: protect device resources after removal

(Hardware) resources which are bound to the driver and device lifecycle
must not be accessed after the device and driver are unbound.

However, the DRM device isn't freed as long as the last user closed it,
hence userspace can still call into the driver.

Therefore protect the critical sections which are accessing those
resources with drm_dev_enter() and drm_dev_exit().

Fixes: 603972f59d8e ("drm/vc4: plane: Switch to drmm_universal_plane_alloc()")
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20220824161327.330627-3-dakr@redhat.com
drivers/gpu/drm/vc4/vc4_plane.c