Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 307094
b: refs/heads/master
c: f1ae126
h: refs/heads/master
v: v3
  • Loading branch information
Ville Syrjälä authored and Dave Airlie committed Apr 24, 2012
1 parent 747ad13 commit 0400481
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 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: 343d4a79fdaeb8753201324c03fbc108f4e62636
refs/heads/master: f1ae126cdf1d1514da6e89a248232a7f7d315fe0
9 changes: 5 additions & 4 deletions trunk/drivers/gpu/drm/drm_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,12 @@ static int drm_ctxbitmap_next(struct drm_device * dev)
mutex_lock(&dev->struct_mutex);
ret = idr_get_new_above(&dev->ctx_idr, NULL,
DRM_RESERVED_CONTEXTS, &new_id);
if (ret == -EAGAIN) {
mutex_unlock(&dev->struct_mutex);
goto again;
}
mutex_unlock(&dev->struct_mutex);
if (ret == -EAGAIN)
goto again;
else if (ret)
return ret;

return new_id;
}

Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/gpu/drm/drm_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,16 @@ static int drm_mode_object_get(struct drm_device *dev,
again:
if (idr_pre_get(&dev->mode_config.crtc_idr, GFP_KERNEL) == 0) {
DRM_ERROR("Ran out memory getting a mode number\n");
return -EINVAL;
return -ENOMEM;
}

mutex_lock(&dev->mode_config.idr_mutex);
ret = idr_get_new_above(&dev->mode_config.crtc_idr, obj, 1, &new_id);
mutex_unlock(&dev->mode_config.idr_mutex);
if (ret == -EAGAIN)
goto again;
else if (ret)
return ret;

obj->id = new_id;
obj->type = obj_type;
Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/gpu/drm/drm_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,7 @@ drm_gem_handle_create(struct drm_file *file_priv,
spin_unlock(&file_priv->table_lock);
if (ret == -EAGAIN)
goto again;

if (ret != 0)
else if (ret)
return ret;

drm_gem_object_handle_reference(obj);
Expand Down Expand Up @@ -456,8 +455,7 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,

if (ret == -EAGAIN)
goto again;

if (ret != 0)
else if (ret)
goto err;

/* Allocate a reference for the name table. */
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/gpu/drm/drm_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,10 @@ static int drm_minor_get_id(struct drm_device *dev, int type)
ret = idr_get_new_above(&drm_minors_idr, NULL,
base, &new_id);
mutex_unlock(&dev->struct_mutex);
if (ret == -EAGAIN) {
if (ret == -EAGAIN)
goto again;
} else if (ret) {
else if (ret)
return ret;
}

if (new_id >= limit) {
idr_remove(&drm_minors_idr, new_id);
Expand Down

0 comments on commit 0400481

Please sign in to comment.