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>
This commit is contained in:

committed by
Dave Airlie

parent
343d4a79fd
commit
f1ae126cdf
@@ -85,11 +85,12 @@ again:
|
||||
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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user