Przeglądaj źródła

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>
Chris Wilson 14 lat temu
rodzic
commit
9e0ae53404
1 zmienionych plików z 3 dodań i 3 usunięć
  1. 3 3
      drivers/gpu/drm/i915/i915_gem.c

+ 3 - 3
drivers/gpu/drm/i915/i915_gem.c

@@ -1246,7 +1246,7 @@ i915_gem_create_mmap_offset(struct drm_gem_object *obj)
 						    obj->size / PAGE_SIZE, 0, 0);
 						    obj->size / PAGE_SIZE, 0, 0);
 	if (!list->file_offset_node) {
 	if (!list->file_offset_node) {
 		DRM_ERROR("failed to allocate offset for bo %d\n", obj->name);
 		DRM_ERROR("failed to allocate offset for bo %d\n", obj->name);
-		ret = -ENOMEM;
+		ret = -ENOSPC;
 		goto out_free_list;
 		goto out_free_list;
 	}
 	}
 
 
@@ -1258,9 +1258,9 @@ i915_gem_create_mmap_offset(struct drm_gem_object *obj)
 	}
 	}
 
 
 	list->hash.key = list->file_offset_node->start;
 	list->hash.key = list->file_offset_node->start;
-	if (drm_ht_insert_item(&mm->offset_hash, &list->hash)) {
+	ret = drm_ht_insert_item(&mm->offset_hash, &list->hash);
+	if (ret) {
 		DRM_ERROR("failed to add to map hash\n");
 		DRM_ERROR("failed to add to map hash\n");
-		ret = -ENOMEM;
 		goto out_free_mm;
 		goto out_free_mm;
 	}
 	}