diff -rupN mesa-7.7.0~git20091125+mesa-7-7-branch.7fac8ce7/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c mesa-7.7.0~git20091125+mesa-7-7-branch.7fac8ce7-mine/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c --- mesa-7.7.0~git20091125+mesa-7-7-branch.7fac8ce7/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c 2009-11-25 17:56:39.000000000 -0500 +++ mesa-7.7.0~git20091125+mesa-7-7-branch.7fac8ce7-mine/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c 2009-11-26 20:53:21.466438622 -0500 @@ -289,7 +289,7 @@ static struct bo_legacy *bo_allocate(str uint32_t domains, uint32_t flags) { - struct bo_legacy *bo_legacy; + struct bo_legacy *bol; static int pgsize; if (pgsize == 0) @@ -297,30 +297,33 @@ static struct bo_legacy *bo_allocate(str size = (size + pgsize) & ~pgsize; - bo_legacy = (struct bo_legacy*)calloc(1, sizeof(struct bo_legacy)); - if (bo_legacy == NULL) { + bol = (struct bo_legacy*)malloc(sizeof(struct bo_legacy)); + if (bol == NULL) { return NULL; } - bo_legacy->base.bom = (struct radeon_bo_manager*)boml; - bo_legacy->base.handle = 0; - bo_legacy->base.size = size; - bo_legacy->base.alignment = alignment; - bo_legacy->base.domains = domains; - bo_legacy->base.flags = flags; - bo_legacy->base.ptr = NULL; - bo_legacy->map_count = 0; - bo_legacy->next = NULL; - bo_legacy->prev = NULL; - bo_legacy->pnext = NULL; - bo_legacy->pprev = NULL; - bo_legacy->next = boml->bos.next; - bo_legacy->prev = &boml->bos; - boml->bos.next = bo_legacy; - if (bo_legacy->next) { - bo_legacy->next->prev = bo_legacy; + memset(bol, 0, sizeof(struct bo_legacy)); + bol->base.bom = (struct radeon_bo_manager*)boml; + bol->base.size = size; + bol->base.alignment = alignment; + bol->base.domains = domains; + bol->base.flags = flags; +/* + bol->base.handle = 0; + bol->base.ptr = NULL; + bol->map_count = 0; + bol->next = NULL; + bol->prev = NULL; + bol->pnext = NULL; + bol->pprev = NULL; +*/ + bol->next = boml->bos.next; + bol->prev = &boml->bos; + boml->bos.next = bol; + if (bol->next) { + bol->next->prev = bol; } - return bo_legacy; + return bol; } static int bo_dma_alloc(struct radeon_bo *bo) diff -rupN mesa-7.7.0~git20091125+mesa-7-7-branch.7fac8ce7/src/mesa/drivers/dri/radeon/radeon_dma.c mesa-7.7.0~git20091125+mesa-7-7-branch.7fac8ce7-mine/src/mesa/drivers/dri/radeon/radeon_dma.c --- mesa-7.7.0~git20091125+mesa-7-7-branch.7fac8ce7/src/mesa/drivers/dri/radeon/radeon_dma.c 2009-11-25 17:56:39.000000000 -0500 +++ mesa-7.7.0~git20091125+mesa-7-7-branch.7fac8ce7-mine/src/mesa/drivers/dri/radeon/radeon_dma.c 2009-11-26 20:59:02.130437488 -0500 @@ -348,7 +348,8 @@ void radeonReleaseDmaRegions(radeonConte WARN_ONCE("Leaking dma buffer object!\n"); /* force free of buffer so we don't realy start * leaking stuff now*/ - while ((dma_bo->bo = radeon_bo_unref(dma_bo->bo))) {} + /* while ((dma_bo->bo = radeon_bo_unref(dma_bo->bo))) {} */ + radeon_bo_unref(dma_bo->bo); remove_from_list(dma_bo); FREE(dma_bo); continue;