Mesa (master): r600g: In radeon_bo(), call LIST_INITHEAD early.

Tilman Sauerbeck tilman at kemper.freedesktop.org
Wed Oct 27 06:45:17 UTC 2010


Module: Mesa
Branch: master
Commit: c6b10cd986c53f1a99a90f32a66d5058f1d1a3eb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c6b10cd986c53f1a99a90f32a66d5058f1d1a3eb

Author: Tilman Sauerbeck <tilman at code-monkey.de>
Date:   Sat Oct 23 19:05:26 2010 +0200

r600g: In radeon_bo(), call LIST_INITHEAD early.

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 at code-monkey.de>

---

 src/gallium/winsys/r600/drm/radeon_bo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/winsys/r600/drm/radeon_bo.c b/src/gallium/winsys/r600/drm/radeon_bo.c
index 9d664b7..2d08686 100644
--- a/src/gallium/winsys/r600/drm/radeon_bo.c
+++ b/src/gallium/winsys/r600/drm/radeon_bo.c
@@ -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;
 }
 




More information about the mesa-commit mailing list