[PATCH 5/5] nvme-tcp: fix the memleak while create new ctrl failed

From: brookxu.cn
Date: Sat Nov 23 2024 - 08:03:05 EST


From: "Chunguang.xu" <chunguang.xu@xxxxxxxxxx>

Now while we create new ctrl failed, we have not free the
tagset occupied by admin_q, here try to fix it.

Signed-off-by: Chunguang.xu <chunguang.xu@xxxxxxxxxx>
---
drivers/nvme/host/tcp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index 57f0f0290cc8..36c7e49af38a 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -2267,7 +2267,7 @@ static int nvme_tcp_setup_ctrl(struct nvme_ctrl *ctrl, bool new)
}
destroy_admin:
nvme_stop_keep_alive(ctrl);
- nvme_tcp_teardown_admin_queue(ctrl, false);
+ nvme_tcp_teardown_admin_queue(ctrl, new);
return ret;
}

--
2.25.1