diff mbox

nouveau: fix memory leak

Message ID 20100407093336.GE5157@bicker (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter April 7, 2010, 9:33 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/gpu/drm/nouveau/nouveau_grctx.c b/drivers/gpu/drm/nouveau/nouveau_grctx.c
index 32f0e49..06642a5 100644
--- a/drivers/gpu/drm/nouveau/nouveau_grctx.c
+++ b/drivers/gpu/drm/nouveau/nouveau_grctx.c
@@ -134,15 +134,11 @@  nouveau_grctx_fini(struct drm_device *dev)
 	struct drm_nouveau_private *dev_priv = dev->dev_private;
 	struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph;
 
-	if (pgraph->ctxprog) {
-		kfree(pgraph->ctxprog);
-		pgraph->ctxprog = NULL;
-	}
+	kfree(pgraph->ctxprog);
+	pgraph->ctxprog = NULL;
 
-	if (pgraph->ctxvals) {
-		kfree(pgraph->ctxprog);
-		pgraph->ctxvals = NULL;
-	}
+	kfree(pgraph->ctxvals);
+	pgraph->ctxvals = NULL;
 }
 
 void