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
librbd: fix coverity warning for uninitialized member #18129
librbd: fix coverity warning for uninitialized member #18129
Conversation
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.
The newly added states are not needed -- you could just default to the first state assignment.
0087ce9
to
b09ba9a
Compare
@dillaman updated |
@@ -33,7 +33,7 @@ SnapshotProtectRequest<I>::SnapshotProtectRequest(I &image_ctx, | |||
Context *on_finish, | |||
const cls::rbd::SnapshotNamespace &snap_namespace, | |||
const std::string &snap_name) | |||
: Request<I>(image_ctx, on_finish), m_snap_namespace(snap_namespace), m_snap_name(snap_name) { | |||
: Request<I>(image_ctx, on_finish), m_snap_namespace(snap_namespace), m_snap_name(snap_name), m_state(STATE_PROTECT_SNAP) { |
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.
Nit: wrap it down to the next line (with proper indentation) before it exceeds 80 characters
@@ -102,7 +102,7 @@ class MetadataCopyRequest<librbd::MockTestImageCtx> { | |||
return s_instance; | |||
} | |||
|
|||
MetadataCopyRequest() { | |||
MetadataCopyRequest() : on_finish(nullptr) { |
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.
Nit: default initialize to nullptr inline where the variable is defined.
Silence Coverity 1413777 Signed-off-by: Li Wang <laurence.liwang@gmail.com>
Silence coverity 1413790 Signed-off-by: Li Wang <laurence.liwang@gmail.com>
Silence coverity 1396229 Signed-off-by: Li Wang <laurence.liwang@gmail.com>
Silence coverity 1413793 Signed-off-by: Li Wang <laurence.liwang@gmail.com>
Silence coverity 1418957 Signed-off-by: Li Wang <laurence.liwang@gmail.com>
b09ba9a
to
2a8e8c5
Compare
@dillaman updated |
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.
lgtm
No description provided.