summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHenri Verbeet <hverbeet@gmail.com>2010-08-16 22:18:37 +0200
committerHenri Verbeet <hverbeet@gmail.com>2010-08-22 12:43:11 +0200
commit8a878c266a8bf50b49d3ef8c5984790581e33133 (patch)
treebd5ad99c5b0cd93fe48bbc0b7e15a50ddc36c14f /src
parent04094b2da2030a82ff49e647fc8658502f02cea8 (diff)
r600g: Don't blindly unmap NULL->size.
There may actually be something mapped in that range, especially for large buffers like e.g. the GL Drawable.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/winsys/r600/drm/radeon_bo.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/winsys/r600/drm/radeon_bo.c b/src/gallium/winsys/r600/drm/radeon_bo.c
index f259ae7fb5..a1306f6e9d 100644
--- a/src/gallium/winsys/r600/drm/radeon_bo.c
+++ b/src/gallium/winsys/r600/drm/radeon_bo.c
@@ -145,7 +145,9 @@ struct radeon_bo *radeon_bo_decref(struct radeon *radeon, struct radeon_bo *bo)
return NULL;
}
- munmap(bo->data, bo->size);
+ if (bo->map_count) {
+ munmap(bo->data, bo->size);
+ }
memset(&args, 0, sizeof(args));
args.handle = bo->handle;
drmIoctl(radeon->fd, DRM_IOCTL_GEM_CLOSE, &args);