Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed coverity issues in src/acl_kernel.cpp #221

Merged
merged 2 commits into from
Dec 7, 2022

Conversation

haoxian2
Copy link
Contributor

@haoxian2 haoxian2 commented Dec 5, 2022

Fixed coverity issue in acl_kernel.cpp: Type: Invalid type in argument to printf format specifier (PRINTF_ARGS)

local_work_size[idim] is of type size_t therefore using %zu instead of %d.

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.

@haoxian2 haoxian2 requested review from pcolberg and zibaiwan December 5, 2022 20:57
Copy link
Contributor

@pcolberg pcolberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @haoxian2!

@haoxian2 haoxian2 force-pushed the coverity-acl-kernel branch from 96d1a9a to fb3beb6 Compare December 6, 2022 01:09
@haoxian2 haoxian2 requested a review from pcolberg December 6, 2022 01:10
pcolberg
pcolberg previously approved these changes Dec 7, 2022
…t to printf format specifier (PRINTF_ARGS)

`local_work_size[idim]` is of type `size_t` therefore using `%zu` instead of `%d`.
…riable (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.
pcolberg
pcolberg previously approved these changes Dec 7, 2022
@pcolberg pcolberg merged commit 75fba32 into intel:main Dec 7, 2022
@pcolberg pcolberg added the bug Something isn't working label Dec 7, 2022
@pcolberg pcolberg added this to the 2023.1 milestone Dec 7, 2022
@haoxian2 haoxian2 deleted the coverity-acl-kernel branch December 7, 2022 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants