summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2014-10-16 11:54:54 +0200
committerBen Skeggs <bskeggs@redhat.com>2015-06-06 23:36:56 +1000
commit258eea3b7493a4e4e8831efbbb5d0a3e2b1a44aa (patch)
treec68cf77e12c1591b3aa0a56ab4590e75083cf2e1
parentfde212ca47ca9ce76939f332f64578256efdcbbc (diff)
downloadnouveau-258eea3b7493a4e4e8831efbbb5d0a3e2b1a44aa.tar.gz
drm: Do not leak client objects
The memory allocated for a nouveau_cli object in nouveau_cli_create() is never freed. Free the memory in nouveau_cli_destroy() to plug this leak. kmemleak recorded this after running a couple of nouveau test programs. Note that kmemleak points at drm_open_helper() because for some reason it thinks that skipping the first two stack frames is a good idea. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drm/nouveau/nouveau_drm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drm/nouveau/nouveau_drm.c b/drm/nouveau/nouveau_drm.c
index 89049335b..63f1d39e8 100644
--- a/drm/nouveau/nouveau_drm.c
+++ b/drm/nouveau/nouveau_drm.c
@@ -127,6 +127,7 @@ nouveau_cli_destroy(struct nouveau_cli *cli)
nvkm_vm_ref(NULL, &nvxx_client(&cli->base)->vm, NULL);
nvif_client_fini(&cli->base);
usif_client_fini(cli);
+ kfree(cli);
}
static void