diff options
-rw-r--r-- | linux-core/drm_bo.c | 8 |
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) |