[Mesa-dev] [PATCH 2/7] i965/sync: Don't crash when deleting sync object
Chad Versace
chad.versace at intel.com
Fri May 1 13:01:57 PDT 2015
From: Chad Versace <chad at kiwitree.net>
Don't pass NULL to drm_intel_bo_unreference(). It doesn't like that.
Bug found by code inspection.
---
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 e500fa0..3bc32df 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.4.0
More information about the mesa-dev
mailing list