Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 131610
b: refs/heads/master
c: 3e49c4f
h: refs/heads/master
v: v3
  • Loading branch information
Chris Wilson authored and Dave Airlie committed Feb 20, 2009
1 parent 0949e54 commit 01fc49b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 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: ad45aa9e6e010283bbd8cf0c6309866233e113f2
refs/heads/master: 3e49c4f4cf786b70bbc369b99e590de4bebac1b3
20 changes: 12 additions & 8 deletions trunk/drivers/gpu/drm/drm_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,10 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,
return -EBADF;

again:
if (idr_pre_get(&dev->object_name_idr, GFP_KERNEL) == 0)
return -ENOMEM;
if (idr_pre_get(&dev->object_name_idr, GFP_KERNEL) == 0) {
ret = -ENOMEM;
goto err;
}

spin_lock(&dev->object_name_lock);
if (obj->name) {
Expand All @@ -310,12 +312,8 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,
if (ret == -EAGAIN)
goto again;

if (ret != 0) {
mutex_lock(&dev->struct_mutex);
drm_gem_object_unreference(obj);
mutex_unlock(&dev->struct_mutex);
return ret;
}
if (ret != 0)
goto err;

/*
* Leave the reference from the lookup around as the
Expand All @@ -324,6 +322,12 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,
args->name = (uint64_t) obj->name;

return 0;

err:
mutex_lock(&dev->struct_mutex);
drm_gem_object_unreference(obj);
mutex_unlock(&dev->struct_mutex);
return ret;
}

/**
Expand Down

0 comments on commit 01fc49b

Please sign in to comment.