summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_notifier.c
diff options
context:
space:
mode:
authorDave Airlie2010-09-27 08:17:17 +0200
committerDave Airlie2010-10-01 01:17:44 +0200
commit29d08b3efddca628b0360411ab2b85f7b1723f48 (patch)
treef89a8a3069ebe9828b8a08c4b123f52625bf0bc7 /drivers/gpu/drm/nouveau/nouveau_notifier.c
parentdrm: i810/i830: fix locked ioctl variant (diff)
downloadkernel-qcow2-linux-29d08b3efddca628b0360411ab2b85f7b1723f48.tar.gz
kernel-qcow2-linux-29d08b3efddca628b0360411ab2b85f7b1723f48.tar.xz
kernel-qcow2-linux-29d08b3efddca628b0360411ab2b85f7b1723f48.zip
drm/gem: handlecount isn't really a kref so don't make it one.
There were lots of places being inconsistent since handle count looked like a kref but it really wasn't. Fix this my just making handle count an atomic on the object, and have it increase the normal object kref. Now i915/radeon/nouveau drivers can drop the normal reference on userspace object creation, and have the handle hold it. This patch fixes a memory leak or corruption on unload, because the driver had no way of knowing if a handle had been actually added for this object, and the fbcon object needed to know this to clean itself up properly. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_notifier.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_notifier.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_notifier.c b/drivers/gpu/drm/nouveau/nouveau_notifier.c
index 3ec181ff50ce..3c9964a8fbad 100644
--- a/drivers/gpu/drm/nouveau/nouveau_notifier.c
+++ b/drivers/gpu/drm/nouveau/nouveau_notifier.c
@@ -79,6 +79,7 @@ nouveau_notifier_takedown_channel(struct nouveau_channel *chan)
mutex_lock(&dev->struct_mutex);
nouveau_bo_unpin(chan->notifier_bo);
mutex_unlock(&dev->struct_mutex);
+ drm_gem_object_handle_unreference_unlocked(chan->notifier_bo->gem);
drm_gem_object_unreference_unlocked(chan->notifier_bo->gem);
drm_mm_takedown(&chan->notifier_heap);
}