summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordumbbell <dumbbell@FreeBSD.org>2016-03-12 11:57:32 +0000
committerdumbbell <dumbbell@FreeBSD.org>2016-03-12 11:57:32 +0000
commit3c057e4b1fa0583a4ca025153e05a66869a4396e (patch)
tree6dc2d7ee68248e48cf186e0518e7be12ba905be5
parent5d06908346a0d9e815ab557d810bf06c3ed08665 (diff)
downloadFreeBSD-src-3c057e4b1fa0583a4ca025153e05a66869a4396e.zip
FreeBSD-src-3c057e4b1fa0583a4ca025153e05a66869a4396e.tar.gz
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.
-rw-r--r--sys/dev/drm2/i915/i915_dma.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/drm2/i915/i915_dma.c b/sys/dev/drm2/i915/i915_dma.c
index e2d8e4c..97a0eb9 100644
--- a/sys/dev/drm2/i915/i915_dma.c
+++ b/sys/dev/drm2/i915/i915_dma.c
@@ -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);
OpenPOWER on IntegriCloud