summaryrefslogtreecommitdiff
path: root/linux-core/drm_bo.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-03-30 12:23:22 +0200
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-04-03 10:29:14 +0200
commitd85e243259259d7702db0d344ae1ff7d26598227 (patch)
treed20c87a040f752368b483ff983fe65180b80a760 /linux-core/drm_bo.c
parent72d457fc1973a61f906a42d049c1c160cc7dee4e (diff)
Fix an oops when trying to clean a not yet initialized memory type.
Diffstat (limited to 'linux-core/drm_bo.c')
-rw-r--r--linux-core/drm_bo.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/linux-core/drm_bo.c b/linux-core/drm_bo.c
index 1bdc6fef..cea6ef62 100644
--- a/linux-core/drm_bo.c
+++ b/linux-core/drm_bo.c
@@ -1991,10 +1991,16 @@ static int drm_bo_lock_mm(drm_device_t * dev, unsigned mem_type)
drm_mem_type_manager_t *man = &bm->man[mem_type];
if (mem_type == 0 || mem_type >= DRM_BO_MEM_TYPES) {
- DRM_ERROR("Illegal memory manager memory type %u,\n", mem_type);
+ DRM_ERROR("Illegal memory manager memory type %u.\n", mem_type);
return -EINVAL;
}
+ if (!man->has_type) {
+ DRM_ERROR("Memory type %u has not been initialized.\n",
+ mem_type);
+ return 0;
+ }
+
drm_bo_clean_unfenced(dev);
ret = drm_bo_force_list_clean(dev, &man->lru, mem_type, 0, 1, 0);
if (ret)