r600g: Fixed a bo leak in r600_blit_state_ps_shader().
authorTilman Sauerbeck <tilman@code-monkey.de>
Fri, 10 Sep 2010 13:20:15 +0000 (15:20 +0200)
committerTilman Sauerbeck <tilman@code-monkey.de>
Thu, 16 Sep 2010 09:07:32 +0000 (11:07 +0200)
We would leak the newly created bo if it cannot be mapped.

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

index e6ded342e59a9038aabb2265702c13f5d8c1cd1a..e6b3be6d3bf741082202a5244076382cd255b7ab 100644 (file)
@@ -335,10 +335,10 @@ static void r600_blit_state_ps_shader(struct r600_screen *rscreen, struct radeon
        /* simple shader */
        bo = radeon_bo(rscreen->rw, 0, 128, 4096, NULL);
        if (bo == NULL) {
-               radeon_bo_decref(rscreen->rw, bo);
                return;
        }
        if (radeon_bo_map(rscreen->rw, bo)) {
+               radeon_bo_decref(rscreen->rw, bo);
                return;
        }
        switch (rscreen->chip_class) {