r600g: In radeon_bo(), call LIST_INITHEAD early.
authorTilman Sauerbeck <tilman@code-monkey.de>
Sat, 23 Oct 2010 17:05:26 +0000 (19:05 +0200)
committerTilman Sauerbeck <tilman@code-monkey.de>
Wed, 27 Oct 2010 06:44:35 +0000 (08:44 +0200)
radeon_bo_destroy() will want to read the list field. Without this patch,
we'd end up evaluating the list pointers before they have been properly
set up when we destroyed the newly created bo if it cannot be mapped.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
src/gallium/winsys/r600/drm/radeon_bo.c

index 9d664b7e53731ec9502e55438cd5c5496f5f4038..2d08686fc43072d9593957f33c46b592d4f456cd 100644 (file)
@@ -82,6 +82,7 @@ struct radeon_bo *radeon_bo(struct radeon *radeon, unsigned handle,
        bo->handle = handle;
        pipe_reference_init(&bo->reference, 1);
        bo->alignment = alignment;
+       LIST_INITHEAD(&bo->fencedlist);
 
        if (handle) {
                struct drm_gem_open open_arg;
@@ -123,7 +124,6 @@ struct radeon_bo *radeon_bo(struct radeon *radeon, unsigned handle,
        if (ptr) {
                memcpy(bo->data, ptr, size);
        }
-       LIST_INITHEAD(&bo->fencedlist);
        return bo;
 }