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

test: Checking fd for negative before closing #17190

Merged
merged 1 commit into from Aug 24, 2017

Conversation

Projects
None yet
3 participants
@amitkumar50
Copy link
Contributor

commented Aug 23, 2017

Fixes the coverity issue:

** 1395317 Argument cannot be negative
161. negative_return_fn: Function open("bufferlist", 0) returns a
negative number.
162. var_assign: Assigning: signed variable fd = open.

Signed-off-by: Amit Kumar amitkuma@redhat.com

@liewegas

This comment has been minimized.

Copy link
Member

commented Aug 23, 2017

would be better to assert(fd >= 0) after open, or return early if negative. everything between open and close is meaningless of fd is invalid.

@liewegas
Copy link
Member

left a comment

.

@amitkumar50 amitkumar50 force-pushed the amitkumar50:cov-test-1 branch from efd4af7 to 1666d9a Aug 24, 2017

@amitkumar50

This comment has been minimized.

Copy link
Contributor Author

commented Aug 24, 2017

@liewegas Done changes. Thanks.

@liewegas liewegas merged commit 511f71c into ceph:master Aug 24, 2017

4 of 5 checks passed

make check (arm64) make check failed
Details
Docs: build check OK - docs built
Details
Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details
@tchaikov

This comment has been minimized.

Copy link
Contributor

commented Aug 24, 2017

@amitkumar50 could you fix your Signed-off-by line when you send your pull request next time?
instead of

Signed-off-by: Amit Kumar amitkuma@redhat.com

it should look like

Signed-off-by: Amit Kumar <amitkuma@redhat.com>
test: Checking fd for negative before closing
Fixes the coverity issue:

** 1395317 Argument cannot be negative
161. negative_return_fn: Function open("bufferlist", 0) returns a
negative number.
162. var_assign: Assigning: signed variable fd = open.

Signed-off-by: Amit Kumar amitkuma@redhat.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.