summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-08-08 15:41:33 +0200
committerDave Airlie <airlied@redhat.com>2013-08-19 14:16:47 +1000
commit90254ac084a6465e46cdada933bf3a7e9ee90277 (patch)
tree0ab7e76810518282ba09f42eeeebb7f6fffbbef2
parent6eb9278adabd17da3bc1cb843c729d1b10d79c93 (diff)
downloadop-kernel-dev-90254ac084a6465e46cdada933bf3a7e9ee90277.zip
op-kernel-dev-90254ac084a6465e46cdada933bf3a7e9ee90277.tar.gz
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>
-rw-r--r--drivers/gpu/drm/drm_info.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_info.c b/drivers/gpu/drm/drm_info.c
index d4b20ce..9f8fc4c 100644
--- a/drivers/gpu/drm/drm_info.c
+++ b/drivers/gpu/drm/drm_info.c
@@ -218,7 +218,11 @@ int drm_gem_name_info(struct seq_file *m, void *data)
struct drm_device *dev = node->minor->dev;
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);
+ spin_unlock(&dev->object_name_lock);
+
return 0;
}
OpenPOWER on IntegriCloud