[Beignet] [Patch v2 04/10] runtime: initialize the memory content to 0.

xionghu.luo at intel.com xionghu.luo at intel.com
Wed Nov 25 21:59:59 PST 2015


From: Luo Xionghu <xionghu.luo at intel.com>

v2: move the memset inside the pointer check.

Signed-off-by: Luo Xionghu <xionghu.luo at intel.com>
---
 src/cl_api.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/cl_api.c b/src/cl_api.c
index d8ccd7e..7cfded9 100644
--- a/src/cl_api.c
+++ b/src/cl_api.c
@@ -57,6 +57,7 @@ typedef intptr_t cl_device_partition_property;
 	  if (param_value && param_value_size < sizeof(TYPE)*ELT) \
 	      return CL_INVALID_VALUE;  \
 	  if (param_value) { \
+	      memset(param_value, 0, param_value_size); \
 	      memcpy(param_value, (VAL), sizeof(TYPE)*ELT); \
 	  } \
           \
-- 
1.9.1



More information about the Beignet mailing list