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:
parent
b6671531ad
commit
31b81b0dd6
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user