]> err.no Git - linux-2.6/commitdiff
drm: remove hash tables on drm exit
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Fri, 18 Aug 2006 06:37:10 +0000 (16:37 +1000)
committerDave Airlie <airlied@linux.ie>
Thu, 21 Sep 2006 19:32:33 +0000 (05:32 +1000)
Signed-off-by: Dave Airlie <airlied@linux.ie>
drivers/char/drm/drm_drv.c
drivers/char/drm/drm_fops.c

index 654b95cdd9a3ddf378d3054d8f8c312afb27ddf4..b366c5b1bd16713345c56a09e389db70b026e727 100644 (file)
@@ -161,6 +161,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);
        }
 
        /* Clear AGP information */
@@ -299,6 +300,7 @@ static void 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);
        }
 
        drm_ctxbitmap_cleanup(dev);
index 2bbf45d85c35fab53ba3038241d30988f9fab8bd..898f47dafec0b2fc6234e0c7f42ad3a4656e70ef 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)