Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 131615
b: refs/heads/master
c: 8d59bae
h: refs/heads/master
i:
  131613: aae98da
  131611: 0876156
  131607: c8717db
  131599: c796b16
  131583: 6e8b1d1
v: v3
  • Loading branch information
Chris Wilson authored and Dave Airlie committed Feb 20, 2009
1 parent fad0239 commit 9891801
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a35f2e2b83a789e189a501ebd722bc9a1310eb05
refs/heads/master: 8d59bae5d9aae10ab230561519bfb97962509bcb
33 changes: 16 additions & 17 deletions trunk/drivers/gpu/drm/drm_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,27 +301,25 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,
}

spin_lock(&dev->object_name_lock);
if (obj->name) {
args->name = obj->name;
if (!obj->name) {
ret = idr_get_new_above(&dev->object_name_idr, obj, 1,
&obj->name);
args->name = (uint64_t) obj->name;
spin_unlock(&dev->object_name_lock);
return 0;
}
ret = idr_get_new_above(&dev->object_name_idr, obj, 1,
&obj->name);
spin_unlock(&dev->object_name_lock);
if (ret == -EAGAIN)
goto again;

if (ret != 0)
goto err;
if (ret == -EAGAIN)
goto again;

/*
* Leave the reference from the lookup around as the
* name table now holds one
*/
args->name = (uint64_t) obj->name;
if (ret != 0)
goto err;

return 0;
/* Allocate a reference for the name table. */
drm_gem_object_reference(obj);
} else {
args->name = (uint64_t) obj->name;
spin_unlock(&dev->object_name_lock);
ret = 0;
}

err:
mutex_lock(&dev->struct_mutex);
Expand Down Expand Up @@ -452,6 +450,7 @@ drm_gem_object_handle_free(struct kref *kref)
spin_lock(&dev->object_name_lock);
if (obj->name) {
idr_remove(&dev->object_name_idr, obj->name);
obj->name = 0;
spin_unlock(&dev->object_name_lock);
/*
* The object name held a reference to this object, drop
Expand Down

0 comments on commit 9891801

Please sign in to comment.