[Mesa-dev] [PATCH 3/7] i915/sync: Don't crash when deleting sync object

Chad Versace chad.versace at intel.com
Fri May 1 13:01:58 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/i915/intel_syncobj.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i915/intel_syncobj.c b/src/mesa/drivers/dri/i915/intel_syncobj.c
index d918cd7..92a246d 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);
 }
 
-- 
2.4.0



More information about the mesa-dev mailing list