mirror of
https://github.com/torvalds/linux.git
synced 2024-11-08 21:21:47 +00:00
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>
This commit is contained in:
parent
6b19e47dc1
commit
7a59cc34a3
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user