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 <daniels@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Chad Versace
2015-05-05 19:05:29 -07:00
parent a93ab73a07
commit 9cf9a2dec5
+3 -1
View File
@@ -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);
}