public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/2] nvmet-auth: clean up with done_kfree
@ 2022-08-12  3:12 Jackie Liu
  2022-08-12  3:12 ` [PATCH 2/2] nvme-auth: remove the redundant req->cqe->result.u16 assignment operation Jackie Liu
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Jackie Liu @ 2022-08-12  3:12 UTC (permalink / raw)
  To: sagi; +Cc: hch, hare, linux-nvme, kch, liu.yun

From: Jackie Liu <liuyun01@kylinos.cn>

Jump directly to done_kfree to release d, which is consistent with the
code style behind.

Reported-by: Genjian Zhang <zhanggenjian@kylinos.cn>
Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
---
 drivers/nvme/target/fabrics-cmd-auth.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/nvme/target/fabrics-cmd-auth.c b/drivers/nvme/target/fabrics-cmd-auth.c
index c851814d6cb0..17c19614b929 100644
--- a/drivers/nvme/target/fabrics-cmd-auth.c
+++ b/drivers/nvme/target/fabrics-cmd-auth.c
@@ -229,10 +229,8 @@ void nvmet_execute_auth_send(struct nvmet_req *req)
 	}
 
 	status = nvmet_copy_from_sgl(req, 0, d, tl);
-	if (status) {
-		kfree(d);
-		goto done;
-	}
+	if (status)
+		goto done_kfree;
 
 	data = d;
 	pr_debug("%s: ctrl %d qid %d type %d id %d step %x\n", __func__,
-- 
2.25.1



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

end of thread, other threads:[~2022-09-05 14:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-12  3:12 [PATCH 1/2] nvmet-auth: clean up with done_kfree Jackie Liu
2022-08-12  3:12 ` [PATCH 2/2] nvme-auth: remove the redundant req->cqe->result.u16 assignment operation Jackie Liu
2022-08-12  6:02   ` Hannes Reinecke
2022-08-12 17:44   ` Chaitanya Kulkarni
2022-08-14 11:45   ` Sagi Grimberg
2022-08-12  6:01 ` [PATCH 1/2] nvmet-auth: clean up with done_kfree Hannes Reinecke
2022-08-12 17:43 ` Chaitanya Kulkarni
2022-08-14 11:45 ` Sagi Grimberg
2022-09-05 11:02 ` Christoph Hellwig

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