[PATCH 15/15] drm: Fix drm_mode_objecte_get() return values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

Change drm_mode_object_get() to return -ENOMEM if idr_pre_get() fails,
and also handle -ENOSPC from idr_get_new_above().

Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
---
 drivers/gpu/drm/drm_crtc.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 12333ca..8f66a15 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,
 	do {
 		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);
@@ -236,6 +236,9 @@ static int drm_mode_object_get(struct drm_device *dev,
 		mutex_unlock(&dev->mode_config.idr_mutex);
 	} while (ret == -EAGAIN);
 
+	if (ret)
+		return ret;
+
 	obj->id = new_id;
 	obj->type = obj_type;
 	return 0;
-- 
1.7.3.4

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux