From 8669cbc5e651bf4effa20e8c244a5a7d67da6fe9 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Mon, 7 Aug 2006 22:22:10 +1000 Subject: drm: move drm authentication to new generic hash table. Fix drm_remove_magic potential memory leak / corruption. Move drm authentication token hashing to new generic hash table implementation. Signed-off-by: Dave Airlie --- drivers/char/drm/drm_drv.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'drivers/char/drm/drm_drv.c') diff --git a/drivers/char/drm/drm_drv.c b/drivers/char/drm/drm_drv.c index 3da72f7364f0..f9ecc8414b8a 100644 --- a/drivers/char/drm/drm_drv.c +++ b/drivers/char/drm/drm_drv.c @@ -155,12 +155,10 @@ int drm_lastclose(drm_device_t * dev) del_timer(&dev->timer); /* Clear pid list */ - for (i = 0; i < DRM_HASH_SIZE; i++) { - for (pt = dev->magiclist[i].head; pt; pt = next) { - next = pt->next; - drm_free(pt, sizeof(*pt), DRM_MEM_MAGIC); - } - dev->magiclist[i].head = dev->magiclist[i].tail = NULL; + list_for_each_entry_safe(pt, next, &dev->magicfree, head) { + list_del(&pt->head); + drm_ht_remove_item(&dev->magiclist, &pt->hash_item); + drm_free(pt, sizeof(*pt), DRM_MEM_MAGIC); } /* Clear AGP information */ -- cgit v1.2.2