-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
net: sockets: socketpair: fix socketpair coverity issues #25805
net: sockets: socketpair: fix socketpair coverity issues #25805
Conversation
All checks are passing now. Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixes, they look good. We usually add the Coverity CID information to commits that fix these things.
Could you add to each commit this line before/after the "Fixes" line:
Coverity-CID: xxxx
so that we can find from git log whether a certain Coverity issue was fixed or not.
@jukkar Should be good now. Does Coverity mention when a problem is fixed on GitHub? I'll keep an eye on it in any case. |
Unfortunately no. I need to manually mark things fixed in Coverity. |
@pfalcon, @jukkar, @tbursztyka, @carlescufi - should be good to go |
In this, case is_nonblock is false and will_block is true. Therefore, we *may* block, and furthermore we *expect* to block. Checking is_nonblock is, in fact, redundant, and passing K_FOREVER to k_sem_take() is justified. Fixes #25727 Coverity-CID: 210611 Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Fixes #25731 Coverity-CID: 210568 Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Fixes #25736 Coverity-CID: 210583 Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Fixes #25737 Coverity-CID: 210585 Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Fixes #25780 Coverity-CID: 210612 Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Fixes #25788 Coverity-CID: 210581 Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Fixes #25796 Coverity-CID: 210579 Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Fixes #25797 Coverity-CID: 210607 Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Thanks! waiting for the reviewers above to approve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the associations between changes and Coverity IDs don't make sense. Other comments need changes too; I think the ones that are optional note that.
@@ -47,7 +47,12 @@ static const char *const names[] = { | |||
static void hello(int fd, const char *name) | |||
{ | |||
/* write(2) should be used after #25443 */ | |||
send(fd, name, strlen(name), 0); | |||
int res = send(fd, name, strlen(name), 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This checks the return value as Coverity wants, but it's not a good example IMO because surely the failure should be returned to the caller and checked there.
Not blocking, net maintainers should weigh in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's sample code, I'm mostly impartial here. I just thought it would might be useful to print an error message to notify the user who would, presumably, be watching.
tests/net/socket/socketpair/src/test_socketpair_unsupported_calls.c
Outdated
Show resolved
Hide resolved
Well, my primary attention is to the changes outside tests/ and samples/. Changes to those can be treated in more or less lax way, but for changes to the system functional code, would be nice to have clear and detailed commit messages. |
@pabigot, @pfalcon - I believe most of your concerns should be addressed. If there is anything else, please let me know. |
I have no permissions to access the actual errors on coverity.com (error 401), but please let me know if this helps.
Fixes #25793
Fixes #25788
Fixes #25780
Fixes #25737
Fixes #25731
Fixes #25736
Fixes #25727
Fixes #25797