summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2015-05-05 19:05:29 -0700
committerChad Versace <[email protected]>2015-05-07 08:11:21 -0700
commit9cf9a2dec5b3fe3aad878b8ab99d50fbd51e1b9c (patch)
treec388e356e789ae488b6790fd4ce6d437e3504031 /src
parenta93ab73a074e0c25ff5ceca7fc1141a9bea82c8f (diff)
i915/sync: Don't crash when deleting sync object
Don't pass NULL to drm_intel_bo_unreference(). It doesn't like that. Bug found by code inspection. Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i915/intel_syncobj.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_syncobj.c b/src/mesa/drivers/dri/i915/intel_syncobj.c
index d918cd7d02e..92a246dfdae 100644
--- a/src/mesa/drivers/dri/i915/intel_syncobj.c
+++ b/src/mesa/drivers/dri/i915/intel_syncobj.c
@@ -60,7 +60,9 @@ intel_delete_sync_object(struct gl_context *ctx, struct gl_sync_object *s)
{
struct intel_sync_object *sync = (struct intel_sync_object *)s;
- drm_intel_bo_unreference(sync->bo);
+ if (sync->bo)
+ drm_intel_bo_unreference(sync->bo);
+
free(sync);
}