]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Feb 2013 00:27:06 +0000 (18:27 -0600)
commit 25d8999780f8c1f53928f4a24a09c01550423109 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/radeon/radeon_cs.c

index dc8d15a4b6bce8699dc01eadf0d7fe6d746ee89f..178fc7654d28eaccbd0a2780e30172e66b30424f 100644 (file)
@@ -271,8 +271,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;
                        }
                }