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

Unreachable error branch in OS_ObjectIdAllocateNew #1110

Closed
skliper opened this issue Jul 16, 2021 · 0 comments · Fixed by #1327
Closed

Unreachable error branch in OS_ObjectIdAllocateNew #1110

skliper opened this issue Jul 16, 2021 · 0 comments · Fixed by #1327
Labels
coverage unit-test Tickets related to the OSAL unit testing (functional and/or coverage)
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Jul 16, 2021

Is your feature request related to a problem? Please describe.
Code checks for error and if so returns, then checks for not error (always true):

if (return_code != OS_SUCCESS)
{
OS_ObjectIdTransactionCancel(token);
return return_code;
}
if (return_code == OS_SUCCESS)
{
return_code = OS_NotifyEvent(OS_EVENT_RESOURCE_ALLOCATED, token->obj_id, NULL);
}

Describe the solution you'd like
Could be an else, or just remove check... (or test for == OS_SUCCESS and the else could be the error case)

Describe alternatives you've considered
None

Additional context
None

Requester Info
Jacob Hageman - NASA/GSFC

@skliper skliper added the unit-test Tickets related to the OSAL unit testing (functional and/or coverage) label Aug 25, 2021
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
dzbaker added a commit that referenced this issue Feb 27, 2023
…branch-in-OS_ObjectIdAllocateNew

Fix #1110, Modify unreachable branch in OS_ObjectIdAllocateNew
@chillfig chillfig added this to the Equuleus milestone Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coverage unit-test Tickets related to the OSAL unit testing (functional and/or coverage)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants