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

Check Return Value of CFE_SB_CreatePipe #96

Closed
ArielSAdamsNASA opened this issue Oct 1, 2021 · 0 comments · Fixed by #132
Closed

Check Return Value of CFE_SB_CreatePipe #96

ArielSAdamsNASA opened this issue Oct 1, 2021 · 0 comments · Fixed by #132
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@ArielSAdamsNASA
Copy link
Contributor

ArielSAdamsNASA commented Oct 1, 2021

Describe the bug
Calling CFE_SB_CreatePipe without checking return value (as is done elsewhere 9 out of 10 times).

Expected behavior
Check return value of CFE_SB_CreatePipe. Should also check return value of CFE_EVS_Register and CFE_SB_Subscribe as seen in sample_app.

Code snips

ci_lab/fsw/src/ci_lab_app.c

Lines 149 to 154 in 12b8cdd

CFE_EVS_Register(CI_LAB_EventFilters, sizeof(CI_LAB_EventFilters) / sizeof(CFE_EVS_BinFilter_t),
CFE_EVS_EventFilter_BINARY);
CFE_SB_CreatePipe(&CI_LAB_Global.CommandPipe, CI_LAB_PIPE_DEPTH, "CI_LAB_CMD_PIPE");
CFE_SB_Subscribe(CFE_SB_ValueToMsgId(CI_LAB_CMD_MID), CI_LAB_Global.CommandPipe);
CFE_SB_Subscribe(CFE_SB_ValueToMsgId(CI_LAB_SEND_HK_MID), CI_LAB_Global.CommandPipe);

System observed on:
Coverity: https://scan.coverity.com/projects/arielsadamsnasa-cfs-jsf-rules?tab=overview

Additional context
Examples of how return value is checked for CFE_SB_CreatePipe:

https://github.com/nasa/cFE/blob/d03e24e675fcd253222e40a5c544920e03854c5f/modules/tbl/fsw/src/cfe_tbl_task.c#L182-L187

https://github.com/nasa/cFE/blob/5e41330979586bcdb113f491ea6c38ff9975fc72/modules/time/fsw/src/cfe_time_task.c#L181-L186

https://github.com/nasa/sample_app/blob/d009197df721af1f430d173584fa64a507a94a13/fsw/src/sample_app.c#L172-L177

Reporter Info
Ariel Adams, ASRC Federal

@ArielSAdamsNASA ArielSAdamsNASA added the good first issue Good for newcomers label Oct 1, 2021
@skliper skliper added the enhancement New feature or request label Oct 22, 2021
thnkslprpt added a commit to thnkslprpt/ci_lab that referenced this issue Nov 8, 2022
thnkslprpt added a commit to thnkslprpt/ci_lab that referenced this issue Mar 20, 2023
thnkslprpt added a commit to thnkslprpt/ci_lab that referenced this issue Nov 1, 2023
thnkslprpt added a commit to thnkslprpt/ci_lab that referenced this issue Nov 9, 2023
thnkslprpt added a commit to thnkslprpt/ci_lab that referenced this issue Nov 9, 2023
dmknutsen added a commit that referenced this issue Nov 9, 2023
…t-cfe-calls

Fix #96, Check returns from CFE calls during init
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants