Skip to content

Commit 96d1a9a

Browse files
committed
Fixed coverity issue in acl_kernel.cpp: Type: Uninitialized scalar variable (UNINIT)
Function `l_copy_and_adjust_arguments_for_device` at `line 2164` uses `memory_migration.num_mem_objects`, but `memory_migration` has only been declared up until this point. I assume that since there has been no changes to `memory_migration`, upon declaration, the `num_mem_objects` should be set to 0. This assumption is reinforced by the second occurrence of `l_copy_and_adjust_arguments_for_device` at `line 2228` where `memory_migration.num_mem_objects = 0` is been initialized a few lines before.
1 parent af74946 commit 96d1a9a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/acl_kernel.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,6 +1661,7 @@ static cl_int l_enqueue_kernel_with_type(
16611661
acl_dev_kernel_invocation_image_t *invocation = 0;
16621662
cl_context context;
16631663
acl_mem_migrate_t memory_migration;
1664+
memory_migration.num_mem_objects = 0;
16641665
cl_int status = CL_SUCCESS;
16651666
int serialization_needed = 0;
16661667
acl_assert_locked();

0 commit comments

Comments
 (0)