diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2012-03-15 13:58:31 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-04-24 04:50:20 -0400 |
commit | f1ae126cdf1d1514da6e89a248232a7f7d315fe0 (patch) | |
tree | b698a6cfeb735df7873865614f5f834fbcdaace9 /drivers/gpu/drm/drm_stub.c | |
parent | 343d4a79fdaeb8753201324c03fbc108f4e62636 (diff) |
drm: Unify and fix idr error handling
The error handling code w.r.t. idr usage looks inconsistent.
In the case of drm_mode_object_get() and drm_ctxbitmap_next() the error
handling is also incomplete.
Unify the code to follow the same pattern always.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_stub.c')
-rw-r--r-- | drivers/gpu/drm/drm_stub.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index aa454f80e109..ae1ccf1d5d96 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c | |||
@@ -122,11 +122,10 @@ again: | |||
122 | ret = idr_get_new_above(&drm_minors_idr, NULL, | 122 | ret = idr_get_new_above(&drm_minors_idr, NULL, |
123 | base, &new_id); | 123 | base, &new_id); |
124 | mutex_unlock(&dev->struct_mutex); | 124 | mutex_unlock(&dev->struct_mutex); |
125 | if (ret == -EAGAIN) { | 125 | if (ret == -EAGAIN) |
126 | goto again; | 126 | goto again; |
127 | } else if (ret) { | 127 | else if (ret) |
128 | return ret; | 128 | return ret; |
129 | } | ||
130 | 129 | ||
131 | if (new_id >= limit) { | 130 | if (new_id >= limit) { |
132 | idr_remove(&drm_minors_idr, new_id); | 131 | idr_remove(&drm_minors_idr, new_id); |