From 74f6e413d3cba0e95d1233c71e119ff50cd406d2 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 27 Mar 2013 11:32:47 +0000 Subject: [PATCH] gem_fence_thrash: Fix array allocation size for LP64 systems --- tests/gem_fence_thrash.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/gem_fence_thrash.c b/tests/gem_fence_thrash.c index 373c4d0b..3fc72a11 100644 --- a/tests/gem_fence_thrash.c +++ b/tests/gem_fence_thrash.c @@ -72,6 +72,7 @@ bo_create (int fd, int tiling) gem_set_tiling(fd, handle, tiling, 1024); ptr = gem_mmap(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE); + assert(ptr); /* XXX: mmap_gtt pulls the bo into the GTT read domain. */ gem_sync(fd, handle); @@ -111,11 +112,11 @@ _bo_write_verify(struct test *t) assert (t->tiling >= 0 && t->tiling <= I915_TILING_Y); assert (t->num_surfaces > 0); - s = calloc(sizeof(**s), t->num_surfaces); + s = calloc(sizeof(*s), t->num_surfaces); + assert(s); - for (k = 0; k < t->num_surfaces; k++) { + for (k = 0; k < t->num_surfaces; k++) s[k] = bo_create(fd, t->tiling); - } for (k = 0; k < t->num_surfaces; k++) { volatile uint32_t *a = s[k];