r300g: fix crash when adding a new relocation

No idea why it's so hard to reproduce.
Broken with: c35572352e

Thanks to Toni Spets for assistance.
This commit is contained in:
Marek Olšák 2011-04-08 20:42:03 +02:00
parent ff3d7ce201
commit aac4bae986
1 changed files with 2 additions and 1 deletions

View File

@ -265,8 +265,9 @@ static void radeon_add_reloc(struct radeon_cs_context *csc,
}
/* Initialize the new relocation. */
p_atomic_inc(&bo->num_cs_references);
csc->relocs_bo[csc->crelocs] = NULL;
radeon_bo_reference(&csc->relocs_bo[csc->crelocs], bo);
p_atomic_inc(&bo->num_cs_references);
reloc = &csc->relocs[csc->crelocs];
reloc->handle = bo->handle;
reloc->read_domains = rd;