Commit 31b81b0d authored by Ziye Yang's avatar Ziye Yang Committed by Daniel Verkamp
Browse files

bdev, split: check the memory allocaton of spilt_base



Change-Id: I4cc3d6e5397143b0b98d4a222c01a76128093191
Signed-off-by: default avatarZiye Yang <ziye.yang@intel.com>
parent b6671531
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -275,6 +275,10 @@ vbdev_split_create(struct spdk_bdev *base_bdev, uint64_t split_count, uint64_t s
		      base_bdev->name, split_count, split_size_bytes);

	split_base = calloc(1, sizeof(*split_base));
	if (!split_base) {
		SPDK_ERRLOG("Cannot alloc memory for split base pointer\n");
		return -1;
	}
	split_base->base_bdev = base_bdev;
	split_base->ref = 0;