bdev/virtio: check allocation in virtio_user_dev_init()

Change-Id: Ib8cc74b4b975013c97c3b5cc68489d8ac9b3970d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382495
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Daniel Verkamp 2017-10-13 13:00:40 -07:00 committed by Jim Harris
parent 7aa53faabd
commit 64096b6031

View File

@ -194,6 +194,10 @@ virtio_user_dev_init(char *path, int queue_size)
uint64_t max_queues;
dev = calloc(1, sizeof(*dev));
if (dev == NULL) {
return NULL;
}
vdev = &dev->vdev;
vdev->is_hw = 0;