bdev, split: check the memory allocaton of spilt_base

Change-Id: I4cc3d6e5397143b0b98d4a222c01a76128093191
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
This commit is contained in:
Ziye Yang 2017-03-24 09:02:42 +08:00 committed by Daniel Verkamp
parent b6671531ad
commit 31b81b0dd6

View File

@ -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;