drm/i915: Call i915_gem_gtt_fini() when the device is detached

This fixes several memory leaks. Apparently, this problem exists in
Linux 3.8 but the code changed in Linux 3.9 so it may be fixed upstream
already. Still, this is something we need to pay attention to.
This commit is contained in:
Jean-Sébastien Pédron 2016-03-12 11:57:32 +00:00
parent 538cf7be5e
commit 77e6a4072b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=296721

View File

@ -1810,6 +1810,12 @@ int i915_driver_unload(struct drm_device *dev)
if (dev_priv->mmio_map != NULL)
drm_rmmap(dev, dev_priv->mmio_map);
/*
* NOTE Linux<->FreeBSD: Linux forgots to call
* i915_gem_gtt_fini(), causing memory leaks.
*/
i915_gem_gtt_fini(dev);
if (dev_priv->wq != NULL)
taskqueue_free(dev_priv->wq);