summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2013-09-17 14:13:32 +1000
committerBen Skeggs <bskeggs@redhat.com>2013-09-18 00:16:29 +1000
commit7a59cc34a3d7b97a00829613bb1a630f5004643b (patch)
treeaffe3780d3f954f829719b6d34ca6404c104ef38 /drivers/gpu/drm
parent6b19e47dc11ea567ce330098fe9db3b7337e9f34 (diff)
drm/nouveau/ttm: prevent double-free in nouveau_sgdma_create_ttm() failure path
TTM calls the destructor on its own already... Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_sgdma.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_sgdma.c b/drivers/gpu/drm/nouveau/nouveau_sgdma.c
index ca5492ac2da5..0843ebc910d4 100644
--- a/drivers/gpu/drm/nouveau/nouveau_sgdma.c
+++ b/drivers/gpu/drm/nouveau/nouveau_sgdma.c
@@ -104,9 +104,7 @@ nouveau_sgdma_create_ttm(struct ttm_bo_device *bdev,
else
nvbe->ttm.ttm.func = &nv50_sgdma_backend;
- if (ttm_dma_tt_init(&nvbe->ttm, bdev, size, page_flags, dummy_read_page)) {
- kfree(nvbe);
+ if (ttm_dma_tt_init(&nvbe->ttm, bdev, size, page_flags, dummy_read_page))
return NULL;
- }
return &nvbe->ttm.ttm;
}