summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_dma.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-11-15 11:32:30 +0000
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-11-30 23:44:05 +0100
commit42dcedd4f2e715dc0313e359c8288e6397843fff (patch)
treebb5f86097d2e7f5e855824e76fe51bec8e97e635 /drivers/gpu/drm/i915/i915_dma.c
parent8040513870399f1cb032cb8bc805df5042fedcdf (diff)
drm/i915: Use a slab for object allocation
The primary purpose of this was to debug some use-after-free memory corruption that was causing an OOPS inside drm/i915. As it turned out the corruption was being caused elsewhere and i915.ko as a major user of many objects was being hit hardest. Indeed as we do frequent the generic kmalloc caches, dedicating one to ourselves (or at least naming one for us depending upon the core) aids debugging our own slab usage. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Reviewed-by: Ben Widawsky <ben@bwidawsk.net> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_dma.c')
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 80ed75117b6..2635ee6a34d 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1736,6 +1736,9 @@ int i915_driver_unload(struct drm_device *dev)
destroy_workqueue(dev_priv->wq);
+ if (dev_priv->slab)
+ kmem_cache_destroy(dev_priv->slab);
+
pci_dev_put(dev_priv->bridge_dev);
kfree(dev->dev_private);