From 14adf7f70fe1c578c77f28d1bbdb56e782bc840d Mon Sep 17 00:00:00 2001 From: Konrad Sztyber Date: Tue, 31 May 2022 13:20:15 +0200 Subject: [PATCH] nvmf/tcp: unregister timeout poller in qpair_destroy The timeout poller might still be registered when a qpair is destroyed if we send C2HTermReq and then destroy the qpair before host terminates the connection. Fixes #2527 Signed-off-by: Konrad Sztyber Change-Id: I21acc147fdba3aaac66b0c6ed54e155195fe9816 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12844 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Aleksey Marchuk --- lib/nvmf/tcp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/nvmf/tcp.c b/lib/nvmf/tcp.c index 86ecf0044..de1739f4f 100644 --- a/lib/nvmf/tcp.c +++ b/lib/nvmf/tcp.c @@ -552,6 +552,10 @@ _nvmf_tcp_qpair_destroy(void *_tqpair) nvmf_tcp_dump_qpair_req_contents(tqpair); } + /* The timeout poller might still be registered here if we close the qpair before host + * terminates the connection. + */ + spdk_poller_unregister(&tqpair->timeout_poller); spdk_dma_free(tqpair->pdus); free(tqpair->reqs); spdk_free(tqpair->bufs);