diff options
author | Tilman Sauerbeck <[email protected]> | 2010-09-09 15:24:50 +0200 |
---|---|---|
committer | Tilman Sauerbeck <[email protected]> | 2010-09-10 13:09:33 +0200 |
commit | 0b4c529da5c67f9719f4ca92cbeca4fcf826796f (patch) | |
tree | ccffac0ac1f09da0bbfd0ae08c6411cd2157abe6 | |
parent | 56a80535b61a274de7bb88767e5ccd53f781e892 (diff) |
r600g: Only increase a bo's map_count if radeon_bo_map() succeeded.
Signed-off-by: Tilman Sauerbeck <[email protected]>
-rw-r--r-- | src/gallium/winsys/r600/drm/radeon_bo.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/winsys/r600/drm/radeon_bo.c b/src/gallium/winsys/r600/drm/radeon_bo.c index a1306f6e9d2..f79135bfa16 100644 --- a/src/gallium/winsys/r600/drm/radeon_bo.c +++ b/src/gallium/winsys/r600/drm/radeon_bo.c @@ -96,8 +96,8 @@ int radeon_bo_map(struct radeon *radeon, struct radeon_bo *bo) void *ptr; int r; - if (bo->map_count++ != 0) { - return 0; + if (bo->map_count != 0) { + goto success; } /* Zero out args to make valgrind happy */ memset(&args, 0, sizeof(args)); @@ -117,6 +117,10 @@ int radeon_bo_map(struct radeon *radeon, struct radeon_bo *bo) return -errno; } bo->data = ptr; + +success: + bo->map_count++; + return 0; } |