drm/radeon: fix error path in kpage allocation
authorIlija Hadzic <ihadzic@research.bell-labs.com>
Mon, 7 Jan 2013 23:21:59 +0000 (18:21 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 10 Jan 2013 22:05:36 +0000 (17:05 -0500)
Index into chunks[] array doesn't look right.

Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_cs.c

index 45151c49ce8151cb4b7e9c7a7ad854ad7dc6df71..469661fd190331f53230a6d1a524bbaebb040012 100644 (file)
@@ -284,8 +284,8 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data)
                        p->chunks[p->chunk_ib_idx].kpage[1] = kmalloc(PAGE_SIZE, GFP_KERNEL);
                        if (p->chunks[p->chunk_ib_idx].kpage[0] == NULL ||
                            p->chunks[p->chunk_ib_idx].kpage[1] == NULL) {
-                               kfree(p->chunks[i].kpage[0]);
-                               kfree(p->chunks[i].kpage[1]);
+                               kfree(p->chunks[p->chunk_ib_idx].kpage[0]);
+                               kfree(p->chunks[p->chunk_ib_idx].kpage[1]);
                                return -ENOMEM;
                        }
                }