From a93ab73a074e0c25ff5ceca7fc1141a9bea82c8f Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Tue, 5 May 2015 19:05:28 -0700 Subject: [PATCH] i965/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/i965/intel_syncobj.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/intel_syncobj.c b/src/mesa/drivers/dri/i965/intel_syncobj.c index e500fa04c51..3bc32dfa3ee 100644 --- a/src/mesa/drivers/dri/i965/intel_syncobj.c +++ b/src/mesa/drivers/dri/i965/intel_syncobj.c @@ -59,7 +59,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