Fix an oops when trying to clean a not yet initialized memory type.

This commit is contained in:
Thomas Hellstrom 2007-03-30 12:23:22 +02:00
parent 72d457fc19
commit d85e243259

View file

@ -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)