Skip to content

Commit c7d0460

Browse files
sherry-yuanpcolberg
authored andcommitted
Check pointer 'kern->accel_job_ids' for NULL before dereferencing
Pointer 'kern->accel_job_ids' returned from call to function 'acl_malloc' at line 947 may be NULL and will be dereferenced at line 962.
1 parent 76fe6c0 commit c7d0460

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/acl_kernel_if.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,8 @@ int acl_kernel_if_update(const acl_device_def_autodiscovery_t &devdef,
949949
if (kern->num_accel > 0) {
950950
kern->accel_job_ids =
951951
(int volatile **)acl_malloc(kern->num_accel * sizeof(int *));
952+
assert(kern->accel_job_ids);
953+
952954
kern->accel_invoc_queue_depth =
953955
(unsigned int *)acl_malloc(kern->num_accel * sizeof(unsigned int));
954956

0 commit comments

Comments
 (0)