vhost/nvme: release the dev before exit
Fix the memory leaks when construct the vhost nvme dev using the error number of io queues. Change-Id: Ie63e048b355d8a3d602e0da415dca279c0515a8b Signed-off-by: Chen Wang <chenx.wang@intel.com> Reviewed-on: https://review.gerrithub.io/410547 Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Liang Yan <liang.z.yan@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
parent
885160c08b
commit
6cfddbc71d
@ -1267,6 +1267,7 @@ spdk_vhost_nvme_dev_construct(const char *name, const char *cpumask, uint32_t nu
|
||||
}
|
||||
|
||||
if (num_io_queues < 1 || num_io_queues > MAX_IO_QUEUES) {
|
||||
spdk_dma_free(dev);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user