[Beignet] [PATCH 2/2] Benchmark: Fix Benchmark heap use after free problem

Xiuli Pan xiuli.pan at intel.com
Thu May 5 07:29:13 UTC 2016


From: Pan Xiuli <xiuli.pan at intel.com>

Memobject will be release by benchmark runer.
Fixed bug:
https://bugs.freedesktop.org/show_bug.cgi?id=93627

Signed-off-by: Pan Xiuli <xiuli.pan at intel.com>
---
 benchmark/benchmark_copy_buffer.cpp         | 1 -
 benchmark/benchmark_copy_image.cpp          | 1 -
 benchmark/benchmark_read_buffer.cpp         | 1 -
 benchmark/benchmark_read_image.cpp          | 1 -
 benchmark/benchmark_use_host_ptr_buffer.cpp | 1 -
 5 files changed, 5 deletions(-)

diff --git a/benchmark/benchmark_copy_buffer.cpp b/benchmark/benchmark_copy_buffer.cpp
index 6cf3023..b56dcdf 100644
--- a/benchmark/benchmark_copy_buffer.cpp
+++ b/benchmark/benchmark_copy_buffer.cpp
@@ -39,7 +39,6 @@ double benchmark_ ##J ##_buffer_ ##T(void) \
   OCL_UNMAP_BUFFER(1); \
   gettimeofday(&stop,0); \
  \
-  clReleaseMemObject(buf[0]); \
   free(buf_data[0]); \
   buf_data[0] = NULL; \
  \
diff --git a/benchmark/benchmark_copy_image.cpp b/benchmark/benchmark_copy_image.cpp
index f3f98af..dc82a36 100644
--- a/benchmark/benchmark_copy_image.cpp
+++ b/benchmark/benchmark_copy_image.cpp
@@ -54,7 +54,6 @@ double benchmark_ ##J ##_image_ ##T(void) \
   OCL_UNMAP_BUFFER_GTT(1); \
   gettimeofday(&stop,0); \
 \
-  clReleaseMemObject(buf[0]); \
   free(buf_data[0]); \
   buf_data[0] = NULL; \
 \
diff --git a/benchmark/benchmark_read_buffer.cpp b/benchmark/benchmark_read_buffer.cpp
index 855e215..0eb8c7a 100644
--- a/benchmark/benchmark_read_buffer.cpp
+++ b/benchmark/benchmark_read_buffer.cpp
@@ -39,7 +39,6 @@ double benchmark_read_buffer(void)
   OCL_FINISH();
   gettimeofday(&stop,0);
 
-  clReleaseMemObject(buf[0]);
   free(buf_data[0]);
   buf_data[0] = NULL;
 
diff --git a/benchmark/benchmark_read_image.cpp b/benchmark/benchmark_read_image.cpp
index 6e64f5f..2f92024 100644
--- a/benchmark/benchmark_read_image.cpp
+++ b/benchmark/benchmark_read_image.cpp
@@ -57,7 +57,6 @@ double benchmark_read_image(void)
   OCL_FINISH();
   gettimeofday(&stop,0);
 
-  clReleaseMemObject(buf[0]);
   free(buf_data[0]);
   buf_data[0] = NULL;
 
diff --git a/benchmark/benchmark_use_host_ptr_buffer.cpp b/benchmark/benchmark_use_host_ptr_buffer.cpp
index bc33afd..6a8cdd7 100644
--- a/benchmark/benchmark_use_host_ptr_buffer.cpp
+++ b/benchmark/benchmark_use_host_ptr_buffer.cpp
@@ -28,7 +28,6 @@ double benchmark_use_host_ptr_buffer(void)
   }
   gettimeofday(&stop,0);
 
-  clReleaseMemObject(buf[0]);
   free(buf_data[0]);
   buf_data[0] = NULL;
 
-- 
2.5.0



More information about the Beignet mailing list