Skip to content

Commit ef184b8

Browse files
guixinliu1995keithbusch
authored andcommitted
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. Signed-off-by: Guixin Liu <kanie@linux.alibaba.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Keith Busch <kbusch@kernel.org>
1 parent 75011bd commit ef184b8

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/nvme/host/tcp.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,14 +1922,13 @@ static int nvme_tcp_alloc_admin_queue(struct nvme_ctrl *ctrl)
19221922
ctrl->opts->subsysnqn);
19231923
if (!pskid) {
19241924
dev_err(ctrl->device, "no valid PSK found\n");
1925-
ret = -ENOKEY;
1926-
goto out_free_queue;
1925+
return -ENOKEY;
19271926
}
19281927
}
19291928

19301929
ret = nvme_tcp_alloc_queue(ctrl, 0, pskid);
19311930
if (ret)
1932-
goto out_free_queue;
1931+
return ret;
19331932

19341933
ret = nvme_tcp_alloc_async_req(to_tcp_ctrl(ctrl));
19351934
if (ret)

0 commit comments

Comments
 (0)