Commit 69a0f437 authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Jim Harris
Browse files

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: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382851


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 90440e1f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
	}