Remove hash tables on DRM exit.
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Wed, 16 Aug 2006 14:36:56 +0000 (16:36 +0200)
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Wed, 16 Aug 2006 14:36:56 +0000 (16:36 +0200)
linux-core/drm_drv.c
linux-core/drm_fops.c

index 79209db..9712170 100644 (file)
@@ -169,6 +169,7 @@ int drm_lastclose(drm_device_t * dev)
                        drm_ht_remove_item(&dev->magiclist, &pt->hash_item);
                        drm_free(pt, sizeof(*pt), DRM_MEM_MAGIC);
                }
+               drm_ht_remove(&dev->magiclist);
        }
 
 
@@ -349,6 +350,7 @@ static void __exit drm_cleanup(drm_device_t * dev)
        if (dev->maplist) {
                drm_free(dev->maplist, sizeof(*dev->maplist), DRM_MEM_MAPS);
                dev->maplist = NULL;
+               drm_ht_remove(&dev->map_hash);
        }
 
        if (!drm_fb_loaded)
index a58f3ae..691edff 100644 (file)
@@ -53,6 +53,8 @@ static int drm_setup(drm_device_t * dev)
                        return ret;
        }
 
+       dev->magicfree.next = NULL;
+
        /* prebuild the SAREA */
        i = drm_addmap(dev, 0, SAREA_MAX, _DRM_SHM, _DRM_CONTAINS_LOCK, &map);
        if (i != 0)