examples/nvme/hotplug: free task on error path

If the spdk_dma_zmalloc() call for the task buffer fails, we should free
the task before returning an error.

Change-Id: Icf70826dfc7f921d2a18f340480ea7c2ac3df3f4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382851
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Daniel Verkamp 2017-10-17 10:23:36 -07:00 committed by Jim Harris
parent 90440e1fe1
commit 69a0f437db

View File

@ -151,6 +151,7 @@ alloc_task(struct dev_ctx *dev)
task->buf = spdk_dma_zmalloc(g_io_size_bytes, 0x200, NULL);
if (task->buf == NULL) {
free(task);
return NULL;
}