Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme: tcp: remove unnecessary goto statement
@ 2023-12-31  6:56 Guixin Liu
  2024-01-01  9:23 ` Sagi Grimberg
  2024-01-02 21:09 ` Keith Busch
  0 siblings, 2 replies; 4+ messages in thread
From: Guixin Liu @ 2023-12-31  6:56 UTC (permalink / raw)
  To: kbusch, axboe, hch, sagi, hare; +Cc: linux-nvme

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>
---
 drivers/nvme/host/tcp.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index 08805f027810..d3dda851f8dc 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -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)
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvme: tcp: remove unnecessary goto statement
  2023-12-31  6:56 [PATCH] nvme: tcp: remove unnecessary goto statement Guixin Liu
@ 2024-01-01  9:23 ` Sagi Grimberg
  2024-01-02 21:09 ` Keith Busch
  1 sibling, 0 replies; 4+ messages in thread
From: Sagi Grimberg @ 2024-01-01  9:23 UTC (permalink / raw)
  To: Guixin Liu, kbusch, axboe, hch, hare; +Cc: linux-nvme

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvme: tcp: remove unnecessary goto statement
  2023-12-31  6:56 [PATCH] nvme: tcp: remove unnecessary goto statement Guixin Liu
  2024-01-01  9:23 ` Sagi Grimberg
@ 2024-01-02 21:09 ` Keith Busch
  2024-01-03  8:37   ` Sagi Grimberg
  1 sibling, 1 reply; 4+ messages in thread
From: Keith Busch @ 2024-01-02 21:09 UTC (permalink / raw)
  To: Guixin Liu; +Cc: axboe, hch, sagi, hare, linux-nvme

On Sun, Dec 31, 2023 at 02:56:44PM +0800, Guixin Liu wrote:
> 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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvme: tcp: remove unnecessary goto statement
  2024-01-02 21:09 ` Keith Busch
@ 2024-01-03  8:37   ` Sagi Grimberg
  0 siblings, 0 replies; 4+ messages in thread
From: Sagi Grimberg @ 2024-01-03  8:37 UTC (permalink / raw)
  To: Keith Busch, Guixin Liu; +Cc: axboe, hch, hare, linux-nvme


>> 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: ..."?


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-03  8:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-31  6:56 [PATCH] nvme: tcp: remove unnecessary goto statement Guixin Liu
2024-01-01  9:23 ` Sagi Grimberg
2024-01-02 21:09 ` Keith Busch
2024-01-03  8:37   ` Sagi Grimberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox