examples/nvme: fix memory leaks of arbitration case
The ns_ctxs of worker_thread are organised as a list, so they should be freed totally. Change-Id: I348cacb12c338dfe0df100e1dc3de7b9f95bfda1 Signed-off-by: JinYu <jin.yu@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458036 Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
c3d1e498d5
commit
5446c541d3
@ -434,8 +434,16 @@ cleanup(uint32_t task_count)
|
||||
};
|
||||
|
||||
while (worker) {
|
||||
struct ns_worker_ctx *ns_ctx = worker->ns_ctx;
|
||||
|
||||
/* ns_worker_ctx is a list in the worker */
|
||||
while (ns_ctx) {
|
||||
struct ns_worker_ctx *next_ns_ctx = ns_ctx->next;
|
||||
free(ns_ctx);
|
||||
ns_ctx = next_ns_ctx;
|
||||
}
|
||||
|
||||
next_worker = worker->next;
|
||||
free(worker->ns_ctx);
|
||||
free(worker);
|
||||
worker = next_worker;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user