nvme: tcp: remove unnecessary goto statement
authorGuixin Liu <kanie@linux.alibaba.com>
Sun, 31 Dec 2023 06:56:44 +0000 (14:56 +0800)
committerKeith Busch <kbusch@kernel.org>
Wed, 3 Jan 2024 16:09:39 +0000 (08:09 -0800)
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.

Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/tcp.c

index d79811cfa0ce88e4d50f57f4e6938e0436eeaa86..5056bcae2f3912044955fae785d350a256f6247b 100644 (file)
@@ -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)