Skip to contentSkip to conversation

nvme: tcp: remove unnecessary goto statement

PATCH Applied Guixin Liu 3 participants 4 messages Dec 31, 2023 – Jan 3, 2024 NVMe

lore
Share & tools
lore

Guixin Liu

author
#0 lore raw

PATCH 1/1 nvme: tcp: remove unnecessary goto statement

There is no requirement to call nvme_tcp_free_queue() for queue deallocation if the pskid is null or the queue allocation fails, as the NVME_TCP_Q_ALLOCATED flag would not be set in such scenarios.

---
 drivers/nvme/host/tcp.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/nvme/host/tcp.c +2 -3
index 08805f027810..d3dda851f8dc 100644
@@ -1922,14 +1922,13 @@ static int nvme_tcp_alloc_admin_queue(struct nvme_ctrl *ctrl)
 						      ctrl->opts->subsysnqn);
 		if (!pskid) {
 			dev_err(ctrl->device, "no valid PSK found\n");
-			ret = -ENOKEY;
-			goto out_free_queue;
+			return -ENOKEY;
 		}
 	}
 
 	ret = nvme_tcp_alloc_queue(ctrl, 0, pskid);
 	if (ret)
-		goto out_free_queue;
+		return ret;
 
 	ret = nvme_tcp_alloc_async_req(to_tcp_ctrl(ctrl));
 	if (ret)
Signature · 1 line
2.43.0
maintainer Applied
#2 lore raw
In reply to Guixin Liu
Quoted 3 lines · Guixin Liu

There is no requirement to call nvme_tcp_free_queue() for queue deallocation if the pskid is null or the queue allocation fails, as the NVME_TCP_Q_ALLOCATED flag would not be set in such scenarios.

Thanks, applied to nvme-6.8.

maintainer
#3 lore raw
Quoted 6 lines
Quoted 4 lines

There is no requirement to call nvme_tcp_free_queue() for queue deallocation if the pskid is null or the queue allocation fails, as the NVME_TCP_Q_ALLOCATED flag would not be set in such scenarios.

Thanks, applied to nvme-6.8.

Can you change the title prefix to be "nvme-tcp: ..."?