aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nv40_graph.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-26 12:30:09 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-26 12:30:09 -0700
commit31f46717997a83bdf6db0dd04810c0a329eb3148 (patch)
treee10ae643fb03226b639d31f07a7ad70a300d448d /drivers/gpu/drm/nouveau/nv40_graph.c
parentdo_generic_file_read: clear page errors when issuing a fresh read of the page (diff)
parentagp: amd64, fix pci reference leaks (diff)
downloadlinux-dev-31f46717997a83bdf6db0dd04810c0a329eb3148.tar.xz
linux-dev-31f46717997a83bdf6db0dd04810c0a329eb3148.zip
Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: agp: amd64, fix pci reference leaks drm/edid: Allow non-fatal checksum errors in CEA blocks drm/radeon/kms: suppress a build warning (unused variable) drm: Fixes linux-next & linux-2.6 checkstack warnings: nouveau: fix acpi_lid_open undefined drm/radeon/kms: release AGP bridge at suspend
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv40_graph.c')
-rw-r--r--drivers/gpu/drm/nouveau/nv40_graph.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nv40_graph.c b/drivers/gpu/drm/nouveau/nv40_graph.c
index 0616c96e4b67..704a25d04ac9 100644
--- a/drivers/gpu/drm/nouveau/nv40_graph.c
+++ b/drivers/gpu/drm/nouveau/nv40_graph.c
@@ -253,7 +253,11 @@ nv40_graph_init(struct drm_device *dev)
if (!dev_priv->engine.graph.ctxprog) {
struct nouveau_grctx ctx = {};
- uint32_t cp[256];
+ uint32_t *cp;
+
+ cp = kmalloc(sizeof(*cp) * 256, GFP_KERNEL);
+ if (!cp)
+ return -ENOMEM;
ctx.dev = dev;
ctx.mode = NOUVEAU_GRCTX_PROG;
@@ -265,6 +269,8 @@ nv40_graph_init(struct drm_device *dev)
nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_INDEX, 0);
for (i = 0; i < ctx.ctxprog_len; i++)
nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_DATA, cp[i]);
+
+ kfree(cp);
}
/* No context present currently */