]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
build: Fix a couple uninitialized variable warnings 17976/head
authorAdam C. Emerson <aemerson@redhat.com>
Thu, 5 Oct 2017 16:17:33 +0000 (12:17 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Thu, 5 Oct 2017 16:25:16 +0000 (12:25 -0400)
For GCC7.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/cls/journal/cls_journal.cc
src/tools/rbd/action/Import.cc

index f966c07f24aed7c48cc7f04087aed941434d8957..7cc2866586ad8b8eefcff1a58d27dedb8dba2efc 100644 (file)
@@ -404,7 +404,7 @@ int journal_get_splay_width(cls_method_context_t hctx, bufferlist *in,
  */
 int journal_get_pool_id(cls_method_context_t hctx, bufferlist *in,
                             bufferlist *out) {
-  int64_t pool_id;
+  int64_t pool_id = 0;
   int r = read_key(hctx, HEADER_KEY_POOL_ID, &pool_id);
   if (r < 0) {
     return r;
index 3c717855270574547b92b5b300aa2b0d37590cac..1f95c24627128f6e669e17d54b85dc5943a5e362 100644 (file)
@@ -580,7 +580,7 @@ static int do_import_header(int fd, int import_format, uint64_t &size, librbd::I
 
   while (r == 0) {
     __u8 tag;
-    uint64_t length;
+    uint64_t length = 0;
     r = read_tag(fd, RBD_EXPORT_IMAGE_END, image_format, &tag, &length);
     if (r < 0 || tag == RBD_EXPORT_IMAGE_END) {
       break;