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

msg, messages: coverity fixes #13473

Merged
merged 4 commits into from Feb 18, 2017

Conversation

Projects
None yet
6 participants
@tchaikov
Contributor

tchaikov commented Feb 17, 2017

No description provided.

tchaikov added some commits Feb 17, 2017

messages/MOSDBackoff: make *_VERSION static
addresses CID 1400661:  Uninitialized variables  (UNINIT)

Signed-off-by: Kefu Chai <kchai@redhat.com>
msg/simple/Pipe: remove no-op statements
addresses CID 1400658:  Incorrect expression  (NO_EFFECT)

Signed-off-by: Kefu Chai <kchai@redhat.com>
msg/async/AsyncConnection: remove no-ops
addresses CID 1400656:  Incorrect expression  (NO_EFFECT)

Signed-off-by: Kefu Chai <kchai@redhat.com>
@@ -427,9 +427,6 @@ int Pipe::accept()
goto fail_unlocked;
}
// sanitize features
connect.features = connect.features;

This comment has been minimized.

@gregsfortytwo

gregsfortytwo Feb 17, 2017

Member

Did you check the history on these? I don't recognize them but the warning made me concerned they are meant to do something (say, sanitize the feature list into something we understand?) via C++ magic that has failed.

This comment has been minimized.

@tchaikov

tchaikov Feb 17, 2017

Contributor

@gregsfortytwo i did check the history as this statement is quite weird from the first glance. they were meant to do something. the commit Sage changed to this is ff19592. and ceph_sanitize_features() has gone. i see no reason to keep the foo = foo around anymore.

This comment has been minimized.

@liewegas

liewegas Feb 17, 2017

Member

Yep, I was just sloppy removing the sanitize call!

int64_t m_quant_size;
int32_t m_buckets;
const char *m_name = nullptr;
scale_type_d m_scale_type = 0;

This comment has been minimized.

@byo

byo Feb 17, 2017

Contributor

This does not compile. Please initialize with SCALE_LINEAR.

This comment has been minimized.

@tchaikov

tchaikov Feb 17, 2017

Contributor

fixed and repushed.

This comment has been minimized.

@byo

byo Feb 17, 2017

Contributor

@tchaikov huh, the fix won't be that easy, adding default values removed default constructors.

Not that pretty but works:

  struct axis_config_d {
    explicit axis_config_d(const char *name = nullptr,
                           scale_type_d scale_type = SCALE_LINEAR,
                           int64_t min = 0, int64_t quant_size = 0,
                           int32_t buckets = 0)
        : m_name(name),
          m_scale_type(scale_type),
          m_min(min),
          m_quant_size(quant_size),
          m_buckets(buckets) {}

    const char *m_name;
    scale_type_d m_scale_type;
    int64_t m_min;
    int64_t m_quant_size;
    int32_t m_buckets;
  };
common/perf_histogram: initialize member vars of axis_config_d
addresses CID 1400670:    (UNINIT_CTOR)

Signed-off-by: Kefu Chai <kchai@redhat.com>

@liewegas liewegas added the needs-qa label Feb 17, 2017

@tchaikov tchaikov changed the title from msg, rbd-nbd, messages: coverity fixes to msg, messages: coverity fixes Feb 18, 2017

@tchaikov

This comment has been minimized.

Contributor

tchaikov commented Feb 18, 2017

@dillaman i dropped the rbd-nbd changes from this PR, we can come back later with better idea later.

@tchaikov tchaikov merged commit 780f4c0 into ceph:master Feb 18, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details

@tchaikov tchaikov deleted the tchaikov:wip-coverity-fixes branch Feb 18, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment