public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Jackie Liu <liu.yun@linux.dev>
To: sagi@grimberg.me
Cc: hch@lst.de, hare@suse.de, linux-nvme@lists.infradead.org,
	kch@nvidia.com, liu.yun@linux.dev
Subject: [PATCH 1/2] nvmet-auth: clean up with done_kfree
Date: Fri, 12 Aug 2022 11:12:30 +0800	[thread overview]
Message-ID: <20220812031231.3386953-1-liu.yun@linux.dev> (raw)

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



             reply	other threads:[~2022-08-12  3:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-12  3:12 Jackie Liu [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220812031231.3386953-1-liu.yun@linux.dev \
    --to=liu.yun@linux.dev \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=kch@nvidia.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox