]> git.baikalelectronics.ru Git - kernel.git/commit
drm/kms: Catch mode_object lifetime errors
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 14 Jun 2019 06:17:23 +0000 (08:17 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 10 Jul 2019 15:17:14 +0000 (17:17 +0200)
commit7bf14b3bbff53c95da2a69bfac14fa4bde9aefba
tree8630efb14338199c1333ca223d1d1a3b3d6bac3c
parentdf137a6553c367e546c03eea075af8f8298d0208
drm/kms: Catch mode_object lifetime errors

Only dynamic mode objects, i.e. those which are refcounted and have a free
callback, can be added while the overall drm_device is visible to
userspace. All others must be added before drm_dev_register and
removed after drm_dev_unregister.

Small issue around drivers still using the load/unload callbacks, we
need to make sure we set dev->registered so that load/unload code in
these callbacks doesn't trigger false warnings. Only a small
adjustement in drm_dev_register was needed.

Motivated by some irc discussions about object ids of dynamic objects
like blobs become invalid, and me going on a bit an audit spree.

Reviewed-by: Sean Paul <sean@poorly.run>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190614061723.1173-1-daniel.vetter@ffwll.ch
drivers/gpu/drm/drm_drv.c
drivers/gpu/drm/drm_mode_object.c