CID
1160848 (#1 of 1): Uninitialized scalar variable (UNINIT)
uninit_use: Using uninitialized value "best".
Init 'best' with -1 (from the code logic it will be set at least to 0)
to silence coverity.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
acting.size() > 1) {
// look for a local replica. prefer the primary if the
// distance is the same.
- int best;
+ int best = -1;
int best_locality;
for (unsigned i = 0; i < acting.size(); ++i) {
int locality = osdmap->crush->get_common_ancestor_distance(