summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_crtc.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2012-03-15 19:58:31 +0200
committerDave Airlie <airlied@redhat.com>2012-04-24 09:50:20 +0100
commitf1ae126cdf1d1514da6e89a248232a7f7d315fe0 (patch)
treeb698a6cfeb735df7873865614f5f834fbcdaace9 /drivers/gpu/drm/drm_crtc.c
parent343d4a79fdaeb8753201324c03fbc108f4e62636 (diff)
downloadlinux-3.10-f1ae126cdf1d1514da6e89a248232a7f7d315fe0.tar.gz
linux-3.10-f1ae126cdf1d1514da6e89a248232a7f7d315fe0.tar.bz2
linux-3.10-f1ae126cdf1d1514da6e89a248232a7f7d315fe0.zip
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_crtc.c')
-rw-r--r--drivers/gpu/drm/drm_crtc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 4d4e8b05573..a9ca1b80fc2 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -227,7 +227,7 @@ 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);
@@ -235,6 +235,8 @@ again:
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;