]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Initialization of data members 17691/head
authoramitkuma <amitkuma@redhat.com>
Wed, 13 Sep 2017 11:31:08 +0000 (17:01 +0530)
committeramitkuma <amitkuma@redhat.com>
Wed, 22 Nov 2017 15:59:17 +0000 (21:29 +0530)
Fixes the coverity issues:

** 717336 Uninitialized scalar field
CID 717336 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member whitelisted is not initialized
in this constructor nor in any functions that it calls.

** 728001 Uninitialized scalar field
CID 728001 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member priority is not initialized
in this constructor nor in any functions that it calls.

Signed-off-by: Amit Kumar <amitkuma@redhat.com>
src/osd/ClassHandler.h
src/osd/PG.h

index 12de083e3d2e5adc3aa347a833b7ac4b21cdbf5e..64393a7eb97ff9442af729782667e7595eb1ae6d 100644 (file)
@@ -59,7 +59,7 @@ public:
     ClassHandler *handler;
     void *handle;
 
-    bool whitelisted;
+    bool whitelisted = false;
 
     map<string, ClassMethod> methods_map;
     map<string, ClassFilter> filters_map;
index 2cf90d48b194ad8d2a0dd835bfc439e2769c5b61..836f72c7462bde654e3733712f66c03b1989da40 100644 (file)
@@ -1220,7 +1220,7 @@ public:
     bool must_scrub, must_deep_scrub, must_repair;
 
     // Priority to use for scrub scheduling
-    unsigned priority;
+    unsigned priority = 0;
 
     // this flag indicates whether we would like to do auto-repair of the PG or not
     bool auto_repair;