aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-09-21 10:05:24 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2010-09-21 10:05:24 -0400
commit9e0ae53404700f1e4ae1f33b0ff92948ae0e509d (patch)
tree5ea1ff3b885ea0fcda2cf9336444e8a5e9d2e16f
parent4fd21dc8ee6fde52a99042186ff94de1b5e8b43c (diff)
drm/i915: Don't overwrite the returned error-code
During i915_gem_create_mmap_offset() if the subsystem reports an error code, use it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 151fa43e4417..734cc08c3fdb 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1246,7 +1246,7 @@ i915_gem_create_mmap_offset(struct drm_gem_object *obj)
1246 obj->size / PAGE_SIZE, 0, 0); 1246 obj->size / PAGE_SIZE, 0, 0);
1247 if (!list->file_offset_node) { 1247 if (!list->file_offset_node) {
1248 DRM_ERROR("failed to allocate offset for bo %d\n", obj->name); 1248 DRM_ERROR("failed to allocate offset for bo %d\n", obj->name);
1249 ret = -ENOMEM; 1249 ret = -ENOSPC;
1250 goto out_free_list; 1250 goto out_free_list;
1251 } 1251 }
1252 1252
@@ -1258,9 +1258,9 @@ i915_gem_create_mmap_offset(struct drm_gem_object *obj)
1258 } 1258 }
1259 1259
1260 list->hash.key = list->file_offset_node->start; 1260 list->hash.key = list->file_offset_node->start;
1261 if (drm_ht_insert_item(&mm->offset_hash, &list->hash)) { 1261 ret = drm_ht_insert_item(&mm->offset_hash, &list->hash);
1262 if (ret) {
1262 DRM_ERROR("failed to add to map hash\n"); 1263 DRM_ERROR("failed to add to map hash\n");
1263 ret = -ENOMEM;
1264 goto out_free_mm; 1264 goto out_free_mm;
1265 } 1265 }
1266 1266