linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm: nouveau: fix nvbe leakage
@ 2013-10-07 22:14 Geyslan G. Bem
  2013-10-07 22:35 ` Ben Skeggs
  0 siblings, 1 reply; 6+ messages in thread
From: Geyslan G. Bem @ 2013-10-07 22:14 UTC (permalink / raw)
  To: airlied, bskeggs, dri-devel; +Cc: linux-kernel, kernel-br, Geyslan G. Bem

Free memory allocated to nvbe when returning NULL.

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
---
 drivers/gpu/drm/nouveau/nouveau_sgdma.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/nouveau/nouveau_sgdma.c b/drivers/gpu/drm/nouveau/nouveau_sgdma.c
index 0843ebc..af8b66d 100644
--- a/drivers/gpu/drm/nouveau/nouveau_sgdma.c
+++ b/drivers/gpu/drm/nouveau/nouveau_sgdma.c
@@ -105,6 +105,9 @@ nouveau_sgdma_create_ttm(struct ttm_bo_device *bdev,
 		nvbe->ttm.ttm.func = &nv50_sgdma_backend;
 
 	if (ttm_dma_tt_init(&nvbe->ttm, bdev, size, page_flags, dummy_read_page))
+	{
+		kfree(nvbe);
 		return NULL;
+	}
 	return &nvbe->ttm.ttm;
 }
-- 
1.8.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-10-08  9:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-07 22:14 [PATCH] drm: nouveau: fix nvbe leakage Geyslan G. Bem
2013-10-07 22:35 ` Ben Skeggs
2013-10-07 23:36   ` Felipe Pena
2013-10-07 23:39     ` Geyslan Gregório Bem
2013-10-08  1:34       ` Ben Skeggs
2013-10-08  9:15         ` Geyslan Gregório Bem

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).