2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-23 20:53:53 +08:00

drm: fix locking in gem debugfs/procfs file

The idr is protected with our spinlock, if we don't hold that nothing
prevents the gem objects from disappearing from under us.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Daniel Vetter 2013-08-08 15:41:33 +02:00 committed by Dave Airlie
parent 6eb9278ada
commit 90254ac084

View File

@ -218,7 +218,11 @@ int drm_gem_name_info(struct seq_file *m, void *data)
struct drm_device *dev = node->minor->dev; struct drm_device *dev = node->minor->dev;
seq_printf(m, " name size handles refcount\n"); seq_printf(m, " name size handles refcount\n");
spin_lock(&dev->object_name_lock);
idr_for_each(&dev->object_name_idr, drm_gem_one_name_info, m); idr_for_each(&dev->object_name_idr, drm_gem_one_name_info, m);
spin_unlock(&dev->object_name_lock);
return 0; return 0;
} }