test/bdev_ut: fix warning about unitialize value.
gcc version 10.1.1 20200619 releases/gcc-10.1.0-223-gf8e16e23d0 (Clear Linux OS for Intel Architecture) Issue reports: CC test/unit/lib/nvme/nvme_ns_cmd.c/nvme_ns_cmd_ut.o bdev_ut.c: In function ‘bdev_io_alignment_with_boundary’: bdev_ut.c:2146:2: error: ‘buf’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 2146 | free(buf); | ^~~~~~~~~ bdev_ut.c: In function ‘bdev_io_alignment’: bdev_ut.c:2008:2: error: ‘buf’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 2008 | free(buf); | ^~~~~~~~~ Signed-off-by: yidong0635 <dongx.yi@intel.com> Change-Id: I6d1bbf74b230b7bc51646454ddba0db4792f5900 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4693 Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
1903dd1049
commit
9714818d04
@ -1800,7 +1800,7 @@ bdev_io_alignment(void)
|
||||
.bdev_io_cache_size = 2,
|
||||
};
|
||||
int rc;
|
||||
void *buf;
|
||||
void *buf = NULL;
|
||||
struct iovec iovs[2];
|
||||
int iovcnt;
|
||||
uint64_t alignment;
|
||||
@ -2019,7 +2019,7 @@ bdev_io_alignment_with_boundary(void)
|
||||
.bdev_io_cache_size = 2,
|
||||
};
|
||||
int rc;
|
||||
void *buf;
|
||||
void *buf = NULL;
|
||||
struct iovec iovs[2];
|
||||
int iovcnt;
|
||||
uint64_t alignment;
|
||||
|
Loading…
Reference in New Issue
Block a user