Skip to content

Commit

Permalink
drm/nouveau/ttm: prevent double-free in nouveau_sgdma_create_ttm() fa…
Browse files Browse the repository at this point in the history
…ilure path

TTM calls the destructor on its own already...

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ben Skeggs committed Sep 17, 2013
1 parent 6b19e47 commit 7a59cc3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/gpu/drm/nouveau/nouveau_sgdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 7a59cc3

Please sign in to comment.