* [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
* [PATCH 2/2] nvme-auth: remove the redundant req->cqe->result.u16 assignment operation
2022-08-12 3:12 [PATCH 1/2] nvmet-auth: clean up with done_kfree Jackie Liu
@ 2022-08-12 3:12 ` Jackie Liu
2022-08-12 6:02 ` Hannes Reinecke
` (2 more replies)
2022-08-12 6:01 ` [PATCH 1/2] nvmet-auth: clean up with done_kfree Hannes Reinecke
` (3 subsequent siblings)
4 siblings, 3 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>
req->cqe->result.u16 has already been assigned in the previous line, no
need to do it again.
Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
---
drivers/nvme/target/fabrics-cmd.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/nvme/target/fabrics-cmd.c b/drivers/nvme/target/fabrics-cmd.c
index f91a56180d3d..c1dfdfb92ebf 100644
--- a/drivers/nvme/target/fabrics-cmd.c
+++ b/drivers/nvme/target/fabrics-cmd.c
@@ -332,7 +332,6 @@ static void nvmet_execute_io_connect(struct nvmet_req *req)
req->cqe->result.u16 = cpu_to_le16(ctrl->cntlid);
pr_debug("adding queue %d to ctrl %d.\n", qid, ctrl->cntlid);
- req->cqe->result.u16 = cpu_to_le16(ctrl->cntlid);
if (nvmet_has_auth(ctrl))
nvmet_init_auth(ctrl, req);
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] nvmet-auth: clean up with done_kfree
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:01 ` Hannes Reinecke
2022-08-12 17:43 ` Chaitanya Kulkarni
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Hannes Reinecke @ 2022-08-12 6:01 UTC (permalink / raw)
To: Jackie Liu, sagi; +Cc: hch, linux-nvme, kch
On 8/12/22 05:12, Jackie Liu wrote:
> 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__,
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew
Myers, Andrew McDonald, Martje Boudien Moerman
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] nvme-auth: remove the redundant req->cqe->result.u16 assignment operation
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
2 siblings, 0 replies; 9+ messages in thread
From: Hannes Reinecke @ 2022-08-12 6:02 UTC (permalink / raw)
To: Jackie Liu, sagi; +Cc: hch, linux-nvme, kch
On 8/12/22 05:12, Jackie Liu wrote:
> From: Jackie Liu <liuyun01@kylinos.cn>
>
> req->cqe->result.u16 has already been assigned in the previous line, no
> need to do it again.
>
> Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
> ---
> drivers/nvme/target/fabrics-cmd.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/nvme/target/fabrics-cmd.c b/drivers/nvme/target/fabrics-cmd.c
> index f91a56180d3d..c1dfdfb92ebf 100644
> --- a/drivers/nvme/target/fabrics-cmd.c
> +++ b/drivers/nvme/target/fabrics-cmd.c
> @@ -332,7 +332,6 @@ static void nvmet_execute_io_connect(struct nvmet_req *req)
> req->cqe->result.u16 = cpu_to_le16(ctrl->cntlid);
>
> pr_debug("adding queue %d to ctrl %d.\n", qid, ctrl->cntlid);
> - req->cqe->result.u16 = cpu_to_le16(ctrl->cntlid);
> if (nvmet_has_auth(ctrl))
> nvmet_init_auth(ctrl, req);
>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew
Myers, Andrew McDonald, Martje Boudien Moerman
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] nvmet-auth: clean up with done_kfree
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: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
4 siblings, 0 replies; 9+ messages in thread
From: Chaitanya Kulkarni @ 2022-08-12 17:43 UTC (permalink / raw)
To: Jackie Liu; +Cc: hch, hare, sagi, linux-nvme, Chaitanya Kulkarni
On 8/11/22 20:12, Jackie Liu wrote:
> 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>
done_kfree label already has a kfree call.
Looks good.
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
-ck
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] nvme-auth: remove the redundant req->cqe->result.u16 assignment operation
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
2 siblings, 0 replies; 9+ messages in thread
From: Chaitanya Kulkarni @ 2022-08-12 17:44 UTC (permalink / raw)
To: Jackie Liu; +Cc: hch, hare, sagi, linux-nvme, Chaitanya Kulkarni
On 8/11/22 20:12, Jackie Liu wrote:
> From: Jackie Liu <liuyun01@kylinos.cn>
>
> req->cqe->result.u16 has already been assigned in the previous line, no
> need to do it again.
>
> Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
Looks good.
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
-ck
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] nvmet-auth: clean up with done_kfree
2022-08-12 3:12 [PATCH 1/2] nvmet-auth: clean up with done_kfree Jackie Liu
` (2 preceding siblings ...)
2022-08-12 17:43 ` Chaitanya Kulkarni
@ 2022-08-14 11:45 ` Sagi Grimberg
2022-09-05 11:02 ` Christoph Hellwig
4 siblings, 0 replies; 9+ messages in thread
From: Sagi Grimberg @ 2022-08-14 11:45 UTC (permalink / raw)
To: Jackie Liu; +Cc: hch, hare, linux-nvme, kch
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] nvme-auth: remove the redundant req->cqe->result.u16 assignment operation
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
2 siblings, 0 replies; 9+ messages in thread
From: Sagi Grimberg @ 2022-08-14 11:45 UTC (permalink / raw)
To: Jackie Liu; +Cc: hch, hare, linux-nvme, kch
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] nvmet-auth: clean up with done_kfree
2022-08-12 3:12 [PATCH 1/2] nvmet-auth: clean up with done_kfree Jackie Liu
` (3 preceding siblings ...)
2022-08-14 11:45 ` Sagi Grimberg
@ 2022-09-05 11:02 ` Christoph Hellwig
4 siblings, 0 replies; 9+ messages in thread
From: Christoph Hellwig @ 2022-09-05 11:02 UTC (permalink / raw)
To: Jackie Liu; +Cc: sagi, hch, hare, linux-nvme, kch
Thanks,
applied both to nvme-6.1.
^ permalink raw reply [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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.