Skip to content

Commit a4fdab1

Browse files
sherry-yuanpcolberg
authored andcommitted
Check pointer 'kern->accel_invoc_queue_depth' for NULL before dereferencing
Pointer 'kern->accel_invoc_queue_depth' returned from call to function 'acl_malloc' at line 949 may be NULL and will be dereferenced at line 961.
1 parent c7d0460 commit a4fdab1

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
@@ -953,6 +953,7 @@ int acl_kernel_if_update(const acl_device_def_autodiscovery_t &devdef,
953953

954954
kern->accel_invoc_queue_depth =
955955
(unsigned int *)acl_malloc(kern->num_accel * sizeof(unsigned int));
956+
assert(kern->accel_invoc_queue_depth);
956957

957958
// Kernel IRQ is a separate thread. Need to use circular buffer to make this
958959
// multithread safe.

0 commit comments

Comments
 (0)