Skip to content

Commit cfac76e

Browse files
sherry-yuanpcolberg
authored andcommitted
Check pointer 'kern->accel_queue_back' for NULL before dereferencing
Pointer 'kern->accel_queue_back' returned from call to function 'acl_malloc' at line 955 may be NULL and will be dereferenced at line 965
1 parent 11bb001 commit cfac76e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/acl_kernel_if.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,7 @@ int acl_kernel_if_update(const acl_device_def_autodiscovery_t &devdef,
960960
kern->accel_queue_front = (int *)acl_malloc(kern->num_accel * sizeof(int));
961961
assert(kern->accel_queue_front);
962962
kern->accel_queue_back = (int *)acl_malloc(kern->num_accel * sizeof(int));
963+
assert(kern->accel_queue_back);
963964

964965
for (unsigned a = 0; a < kern->num_accel; ++a) {
965966
unsigned int max_same_accel_launches =

0 commit comments

Comments
 (0)