Browse Source

r600g: Fixed a bo leak in the error path of radeon_ctx_set_bo_new().

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
tags/mesa-7.9-rc1
Tilman Sauerbeck 15 years ago
parent
commit
56a80535b6
1 changed files with 1 additions and 2 deletions
  1. 1
    2
      src/gallium/winsys/r600/drm/radeon_ctx.c

+ 1
- 2
src/gallium/winsys/r600/drm/radeon_ctx.c View File

@@ -34,7 +34,7 @@ static int radeon_ctx_set_bo_new(struct radeon_ctx *ctx, struct radeon_bo *bo)
{
if (ctx->nbo >= RADEON_CTX_MAX_PM4)
return -EBUSY;
ctx->bo[ctx->nbo] = bo;
ctx->bo[ctx->nbo] = radeon_bo_incref(ctx->radeon, bo);
ctx->nbo++;
return 0;
}
@@ -137,7 +137,6 @@ static int radeon_ctx_state_bo(struct radeon_ctx *ctx, struct radeon_state *stat
break;
}
if (j == ctx->nbo) {
radeon_bo_incref(ctx->radeon, state->bo[i]);
r = radeon_ctx_set_bo_new(ctx, state->bo[i]);
if (r)
return r;

Loading…
Cancel
Save