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

Coverity and SCA fixes #17431

Merged
merged 10 commits into from Sep 5, 2017
Merged

Coverity and SCA fixes #17431

merged 10 commits into from Sep 5, 2017

Conversation

tchaikov
Copy link
Contributor

@tchaikov tchaikov commented Sep 2, 2017

No description provided.

since it isn't used

Fix for:

CID 1394854 (#1 of 1): 'Constant' variable guards dead code (DEADCODE)
 dead_error_line: Execution cannot reach this statement:
 opts->set(RBD_IMAGE_OPTION_....
 Local variable features_set_specified is assigned only once, to a
 constant value, making it effectively constant throughout its scope.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Don't call put_request() twice, it's already called by
unregister_request()

Fix for:

CID 1405360 (#1 of 1): Use after free (USE_AFTER_FREE)
 deref_arg: Calling put_request dereferences freed pointer request

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
calloc() does not take negative values, check return value from
get_max_buckets() and handle it correctly.

Fix for:

CID 1405301 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
 negative_returns: arg_map.size is passed to a parameter that cannot
 be negative.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix for:

CID 1406088 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
 uninit_member: Non-static class member root_ancestor is not
 initialized in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix for:

CID 717207 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
 uninit_member: Non-static class member dirp is not initialized
 in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix for:

CID 1405070 (#1 of 1): Memset fill value of '0' (NO_EFFECT)
CID 1405071 (#1 of 1): Memset fill value of '0' (NO_EFFECT)
CID 1405073 (#1 of 1): Memset fill value of '0' (NO_EFFECT)
CID 1405074 (#1 of 1): Memset fill value of '0' (NO_EFFECT)
CID 1405075 (#1 of 1): Memset fill value of '0' (NO_EFFECT)
CID 1405077 (#1 of 1): Memset fill value of '0' (NO_EFFECT)
CID 1405083 (#1 of 1): Memset fill value of '0' (NO_EFFECT)
CID 1405086 (#1 of 1): Memset fill value of '0' (NO_EFFECT)
CID 1405087 (#1 of 1): Memset fill value of '0' (NO_EFFECT)
 bad_memset: "memset" with fill value "'0'" (the zero character).
 memset(&net, 48, 28UL). (CWE-665)

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix for:

CID 1396232 (#1 of 1): Non-virtual destructor (VIRTUAL_DTOR)
 nonvirtual_dtor: Class librbd::<unnamed>::SafeTimerSingleton has a
 destructor and a pointer to it is upcast to class SafeTimer which
 doesn't have a virtual destructor.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix for:

CID 1402624 (#1 of 1): Uninitialized scalar variable (UNINIT)
 uninit_use: Using uninitialized value sin. Field sin.sin_zero is
 uninitialized.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1219593 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable completion going out of scope leaks
 the storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix for:

CID 1313405 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable my_completion2 going out of scope
 leaks the storage it points to.

CID 1219522 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable my_completion going out of scope
 leaks the storage it points to.

CID 1219501 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable my_completion going out of scope
 leaks the storage it points to.

CID 1313406 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable my_completion2 going out of scope
 leaks the storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
@joscollin
Copy link
Member

Jenkins retest this please

Copy link

@dillaman dillaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@tchaikov tchaikov merged commit e99c535 into ceph:master Sep 5, 2017
@tchaikov tchaikov deleted the wip-da-SCA-20170510 branch September 5, 2017 04:53
@dalgaaf
Copy link
Contributor

dalgaaf commented Sep 21, 2017

@tchaikov thanks for the work! Totally missed my pull request due to other projects!

@tchaikov
Copy link
Contributor Author

@dalgaaf my pleasure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants