From: Danny Al-Gaaf Date: Wed, 4 Jun 2014 21:10:42 +0000 (+0200) Subject: test/librbd/fsx.c: fix gcc warning X-Git-Tag: v0.83~134^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f17a9633fc044b8b073f15ac2762b6c32a32d77e;p=ceph.git test/librbd/fsx.c: fix gcc warning Initialize pointer with NULL before call posix_memalign() to fix gcc warning: test/librbd/fsx.c:1402:13: warning: ‘temp_buf’ may be used uninitialized in this function [-Wmaybe-uninitialized] if ((ret = ops->read(&cur_ctx, 0, file_info.st_size, temp_buf)) < 0) { ^ test/librbd/fsx.c:1398:13: warning: ‘good_buf’ may be used uninitialized in this function [-Wmaybe-uninitialized] if ((ret = pread(fd, good_buf, file_info.st_size, 0)) < 0) { Signed-off-by: Danny Al-Gaaf --- diff --git a/src/test/librbd/fsx.c b/src/test/librbd/fsx.c index 20106e02c1c4..a8df394b271e 100644 --- a/src/test/librbd/fsx.c +++ b/src/test/librbd/fsx.c @@ -1381,6 +1381,7 @@ check_clone(int clonenum) exit(169); } + good_buf = NULL; ret = posix_memalign((void **)&good_buf, MAX(writebdy, sizeof(void *)), file_info.st_size); if (ret > 0) { @@ -1388,6 +1389,7 @@ check_clone(int clonenum) exit(96); } + temp_buf = NULL; ret = posix_memalign((void **)&temp_buf, MAX(readbdy, sizeof(void *)), file_info.st_size); if (ret > 0) {