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 <daniels@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Chad Versace 2015-05-05 19:05:28 -07:00
parent a6bfdd7b46
commit a93ab73a07

View file

@ -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);
}