From 1a9e5bae109b476f9ee34975242c8938aaac4146 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Tue, 6 Jun 2006 17:46:17 +0000 Subject: Fix drm_remove_magic potential memory leak / corruption. Move drm authentication token hashing to new generic hash table implementation. --- linux-core/drm_fops.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'linux-core/drm_fops.c') diff --git a/linux-core/drm_fops.c b/linux-core/drm_fops.c index a1962135..632108db 100644 --- a/linux-core/drm_fops.c +++ b/linux-core/drm_fops.c @@ -72,10 +72,8 @@ static int drm_setup(drm_device_t * dev) for (i = 0; i < DRM_ARRAY_SIZE(dev->counts); i++) atomic_set(&dev->counts[i], 0); - for (i = 0; i < DRM_HASH_SIZE; i++) { - dev->magiclist[i].head = NULL; - dev->magiclist[i].tail = NULL; - } + drm_ht_create(&dev->magiclist, DRM_MAGIC_HASH_ORDER); + INIT_LIST_HEAD(&dev->magicfree); dev->ctxlist = drm_alloc(sizeof(*dev->ctxlist), DRM_MEM_CTXLIST); if (dev->ctxlist == NULL) -- cgit v1.2.3