[Beignet] [PATCH 2/2] Fix DRM Memory leak BUG

Pan Xiuli xiuli.pan at intel.com
Mon Sep 21 01:41:52 PDT 2015


This bug is cased by event flush, we should not only run usr event but also
event made by enqueue functions.
If the event haven't been completed before it is been overwite in the
last_event, the related gpgpu buffer will not be unreference. And will cause
all related drm buffers unreference and thenw leak.

Signed-off-by: Pan Xiuli <xiuli.pan at intel.com>
---
 src/cl_command_queue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cl_command_queue.c b/src/cl_command_queue.c
index 4b92311..fd1d613 100644
--- a/src/cl_command_queue.c
+++ b/src/cl_command_queue.c
@@ -261,7 +261,7 @@ cl_command_queue_flush(cl_command_queue queue)
   // the event any more. If we don't do this here, we will leak that event
   // and all the corresponding buffers which is really bad.
   cl_event last_event = get_last_event(queue);
-  if (last_event && last_event->user_cb)
+  if (last_event)
     cl_event_update_status(last_event, 1);
   cl_event current_event = get_current_event(queue);
   if (current_event && err == CL_SUCCESS) {
-- 
2.1.4



More information about the Beignet mailing list