diff options
author | Luo Xionghu <xionghu.luo@intel.com> | 2016-05-06 00:11:47 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2016-05-23 18:07:21 +0800 |
commit | 0ad68c09087b2fab4b1ff2ebc9ed38ea0258794c (patch) | |
tree | f70ad6a3ad08f579dcb587188253e3452b40959f /utests/load_program_from_gen_bin.cpp | |
parent | d30f395244949742f8a0aad83e8720d3c50f0fe1 (diff) | |
download | beignet-0ad68c09087b2fab4b1ff2ebc9ed38ea0258794c.tar.gz |
utest: error handling to avoid null pointer dereference.
Signed-off-by: Luo Xionghu <xionghu.luo@intel.com>
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
Diffstat (limited to 'utests/load_program_from_gen_bin.cpp')
-rw-r--r-- | utests/load_program_from_gen_bin.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/utests/load_program_from_gen_bin.cpp b/utests/load_program_from_gen_bin.cpp index 7504aa3e..5a9c901b 100644 --- a/utests/load_program_from_gen_bin.cpp +++ b/utests/load_program_from_gen_bin.cpp @@ -18,6 +18,10 @@ static void test_load_program_from_gen_bin(void) char *ker_path = NULL; cl_file_map_t *fm = cl_file_map_new(); + if(!fm) { + fprintf(stderr, "run out of memory\n"); + return; + } ker_path = cl_do_kiss_path("compiler_ceil.cl", device); OCL_ASSERT (cl_file_map_open(fm, ker_path) == CL_FILE_MAP_SUCCESS); |