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:
parent
90440e1fe1
commit
69a0f437db
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user