summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorJerome Glisse <glisse@freedesktop.org>2008-11-17 13:35:51 +0100
committerJerome Glisse <glisse@freedesktop.org>2008-11-17 13:35:51 +0100
commite98eda91593b7c0a7494475be8cfd8cb4740f8ec (patch)
tree8fc2affe872610dfe08c77e9173e9781256d69c4 /linux-core
parentf46aba43329786c9b2776e82af31d90e1c67eae0 (diff)
Revert "gem: protect idr_pre with the spinlock"
This reverts commit f46aba43329786c9b2776e82af31d90e1c67eae0.
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drm_gem.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/linux-core/drm_gem.c b/linux-core/drm_gem.c
index 0078929a..607c8b67 100644
--- a/linux-core/drm_gem.c
+++ b/linux-core/drm_gem.c
@@ -175,11 +175,12 @@ drm_gem_handle_create(struct drm_file *file_priv,
* Get the user-visible handle using idr.
*/
again:
- /* do the allocation under our spinlock */
- spin_lock(&file_priv->table_lock);
/* ensure there is space available to allocate a handle */
if (idr_pre_get(&file_priv->object_idr, GFP_KERNEL) == 0)
return -ENOMEM;
+
+ /* do the allocation under our spinlock */
+ spin_lock(&file_priv->table_lock);
ret = idr_get_new_above(&file_priv->object_idr, obj, 1, handlep);
spin_unlock(&file_priv->table_lock);
if (ret == -EAGAIN)
@@ -257,9 +258,10 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,
return -EINVAL;
again:
- spin_lock(&dev->object_name_lock);
if (idr_pre_get(&dev->object_name_idr, GFP_KERNEL) == 0)
return -ENOMEM;
+
+ spin_lock(&dev->object_name_lock);
if (obj->name) {
args->name = (uint64_t) obj->name;
spin_unlock(&dev->object_name_lock);