Fix memory cache initialization.
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Tue, 5 Sep 2006 09:00:52 +0000 (11:00 +0200)
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Tue, 5 Sep 2006 09:00:52 +0000 (11:00 +0200)
linux-core/drm_drv.c

index bca7b86..89b20a9 100644 (file)
@@ -443,7 +443,7 @@ static int drm_create_memory_caches(void)
                                                  0,
                                                  SLAB_HWCACHE_ALIGN,
                                                  NULL,NULL);
-       if (!drm_cache.ref_object)
+       if (!drm_cache.fence_object)
                return -ENOMEM;
 
        drm_cache.ref_object= kmem_cache_create("drm_ref_object_t", 
@@ -524,6 +524,7 @@ err_p2:
        unregister_chrdev(DRM_MAJOR, "drm");
        drm_free(drm_heads, sizeof(*drm_heads) * drm_cards_limit, DRM_MEM_STUB);
 err_p1:
+       drm_free_memory_caches();
        return ret;
 }