Commit a6b92896 authored by Alexey Marchuk's avatar Alexey Marchuk Committed by Tomasz Zawadzki
Browse files

perf: Fix memory leak when IO submit failed



When submit_io cb returns bad status, current
task is dropped and allocated memory is not cleaned.

Change-Id: Ibc33e76e6800644c29eaeb826a3401ad5d5fd582
Signed-off-by: default avatarAlexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7376


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 364ad5ae
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1378,6 +1378,10 @@ submit_single_io(struct perf_task *task)

	if (spdk_unlikely(rc != 0)) {
		RATELIMIT_LOG("starting I/O failed\n");
		spdk_dma_free(task->iovs[0].iov_base);
		free(task->iovs);
		spdk_dma_free(task->md_iov.iov_base);
		free(task);
	} else {
		ns_ctx->current_queue_depth++;
	}