drm/nouveau/mmu: fix comptag memory leak
authorBen Skeggs <bskeggs@redhat.com>
Wed, 22 Jan 2020 22:23:06 +0000 (08:23 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Feb 2020 07:34:50 +0000 (08:34 +0100)
[ Upstream commit 35e4909b6a2b4005ced3c4238da60d926b78fdea ]

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/nouveau/nvkm/core/memory.c

index e85a08e..4cc1862 100644 (file)
@@ -91,8 +91,8 @@ nvkm_memory_tags_get(struct nvkm_memory *memory, struct nvkm_device *device,
        }
 
        refcount_set(&tags->refcount, 1);
+       *ptags = memory->tags = tags;
        mutex_unlock(&fb->subdev.mutex);
-       *ptags = tags;
        return 0;
 }