From: Chad Versace Date: Wed, 6 May 2015 02:05:29 +0000 (-0700) Subject: i915/sync: Don't crash when deleting sync object X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9cf9a2dec5b3fe3aad878b8ab99d50fbd51e1b9c;p=mesa.git 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 --- 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); }