From 9cf9a2dec5b3fe3aad878b8ab99d50fbd51e1b9c Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Tue, 5 May 2015 19:05:29 -0700 Subject: [PATCH] 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 Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/i915/intel_syncobj.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); } -- 2.30.2