aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nv20_graph.c
diff options
context:
space:
mode:
authorJesper Juhl <jj@chaosbits.net>2011-07-04 09:46:53 +1000
committerBen Skeggs <bskeggs@redhat.com>2011-07-25 09:40:52 +1000
commit1541fa854273abee954ec4ca4ad65fe4ceb9e626 (patch)
tree01e83ad9133a11d78b73c3999906119c77d34204 /drivers/gpu/drm/nouveau/nv20_graph.c
parent88c8431cbbccdb9ef7c13f0ba18022e2cb35c7f7 (diff)
drm/nouveau: do not leak in nv20_graph_create
If we return due to an unknown chipset in drivers/gpu/drm/nouveau/nv20_graph.c:nv20_graph_create() we'll leak the memory allocated to 'pgraph'. This patch should fix the leak. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Reviewed-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv20_graph.c')
-rw-r--r--drivers/gpu/drm/nouveau/nv20_graph.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nv20_graph.c b/drivers/gpu/drm/nouveau/nv20_graph.c
index affc7d7dd02..f8736270f62 100644
--- a/drivers/gpu/drm/nouveau/nv20_graph.c
+++ b/drivers/gpu/drm/nouveau/nv20_graph.c
@@ -753,6 +753,7 @@ nv20_graph_create(struct drm_device *dev)
break;
default:
NV_ERROR(dev, "PGRAPH: unknown chipset\n");
+ kfree(pgraph);
return 0;
}
} else {
@@ -774,6 +775,7 @@ nv20_graph_create(struct drm_device *dev)
break;
default:
NV_ERROR(dev, "PGRAPH: unknown chipset\n");
+ kfree(pgraph);
return 0;
}
}