From 87c0fd23994d316ef41a776fb7d830e7935f60e9 Mon Sep 17 00:00:00 2001 From: Jos Collin Date: Fri, 31 Mar 2017 20:01:23 +0530 Subject: [PATCH] =?UTF-8?q?rbd:=20warning,=20=E2=80=98devno=E2=80=99=20may?= =?UTF-8?q?=20be=20used=20uninitialized=20in=20this=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The following warning appears during make. Fixed in both unmap_image() functions in krbd.cc -- krbd.cc: In function ‘int krbd_unmap_by_spec(krbd_ctx*, const char*, const char*, const char*, const char*)’: krbd.cc:608:65: warning: ‘devno’ may be used uninitialized in this function [-Wmaybe-uninitialized] return do_unmap(ctx->udev, devno, build_unmap_buf(id, options)); ^ krbd.cc:591:9: note: ‘devno’ was declared here dev_t devno; -- Signed-off-by: Jos Collin --- src/krbd.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/krbd.cc b/src/krbd.cc index d1cdf552977..fe0d8c2b285 100644 --- a/src/krbd.cc +++ b/src/krbd.cc @@ -552,7 +552,7 @@ static int unmap_image(struct krbd_ctx *ctx, const char *devnode, const char *options) { struct stat sb; - dev_t wholedevno; + dev_t wholedevno = 0; string id; int r; @@ -588,7 +588,7 @@ static int unmap_image(struct krbd_ctx *ctx, const char *pool, const char *image, const char *snap, const char *options) { - dev_t devno; + dev_t devno = 0; string id; int r;