drm/ttm: check the return value of kzalloc
[sfrench/cifs-2.6.git] / drivers / gpu / drm / ttm / ttm_page_alloc.c
index b5ba6441489f6e4f28f6e71129dfede3361bd262..5d252fb27a8228d6d92fe10f2db605a1a7a4a8a6 100644 (file)
@@ -1007,6 +1007,8 @@ int ttm_page_alloc_init(struct ttm_mem_global *glob, unsigned max_pages)
        pr_info("Initializing pool allocator\n");
 
        _manager = kzalloc(sizeof(*_manager), GFP_KERNEL);
+       if (!_manager)
+               return -ENOMEM;
 
        ttm_page_pool_init_locked(&_manager->wc_pool, GFP_HIGHUSER, "wc", 0);