Skip to content

Unreachable error branch in OS_ObjectIdAllocateNew #1110

@skliper

Description

@skliper

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    coverageunit-testTickets related to the OSAL unit testing (functional and/or coverage)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions