Skip to content

Fixed coverity in acl_globals.cpp #231

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

Merged
merged 1 commit into from
Jan 10, 2023

Conversation

haoxian2
Copy link
Contributor

@haoxian2 haoxian2 commented Dec 14, 2022

Fixed coverity in acl_globals.cpp: Unchecked return value (CHECKED_RETURN)

Coverity was complaining that acl_set_hal function return value was not checked. The function acl_init_from_hal_discovery that contains the acl_set_hal issue is initializing the HAL and load the builtin system definition. acl_set_hal returns 0 if HAL is unvalid. Since the HAL is normally just set once on startup and then not changed, I believe that if the HAL is not valid, it should be considered as uninitialized since we cannot fetch the correct builtin system definition.

…TURN)

The function acl_init_from_hal_discovery that contains the acl_set_hal issue is initializing the HAL and load the builtin system definition. acl_set_hal returns 0 if HAL is unvalid. Therefore, I believe that if the HAL is not valid, it should be considered as uninitialized since we cannot fetch the correct builtin system definition.
@haoxian2 haoxian2 force-pushed the coverity-acl-globals branch from 201cb25 to 949c628 Compare December 14, 2022 17:53
@pcolberg pcolberg added this to the 2023.2 milestone Dec 23, 2022
@pcolberg pcolberg added the bug Something isn't working label Dec 23, 2022
Copy link
Contributor

@zibaiwan zibaiwan 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 . I agree with your analysis, acl_set_hal must succeed otherwise it should return CL_FALSE.

@zibaiwan zibaiwan merged commit 24108ed into intel:main Jan 10, 2023
@haoxian2 haoxian2 deleted the coverity-acl-globals branch January 10, 2023 23:16
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.

3 participants