nvmet-auth: clean up with done_kfree
Subsystems (3)
PATCH 1/2 nvmet-auth: clean up with done_kfree
From: Jackie Liu <[email protected]>
Jump directly to done_kfree to release d, which is consistent with the code style behind.
--- drivers/nvme/target/fabrics-cmd-auth.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/nvme/target/fabrics-cmd-auth.c +2 -4
@@ -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__,
Signature · 1 line
2.25.1
PATCH 2/2 nvme-auth: remove the redundant req->cqe->result.u16 assignment operation
From: Jackie Liu <[email protected]>
req->cqe->result.u16 has already been assigned in the previous line, no need to do it again.
--- drivers/nvme/target/fabrics-cmd.c | 1 - 1 file changed, 1 deletion(-)
drivers/nvme/target/fabrics-cmd.c +0 -1
@@ -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);
Signature · 1 line
2.25.1
Re: [PATCH 2/2] nvme-auth: remove the redundant req->cqe->result.u16 assignment operation
Quoted 15 lines · Jackie Liu
From: Jackie Liu <[email protected]>
req->cqe->result.u16has already been assigned in the previous line, no need to do it again.Signed-off-by Jackie Liu <[email protected]>--- drivers/nvme/target/fabrics-cmd.c | 1 - 1 file changed, 1 deletion(-)drivers/nvme/target/fabrics-cmd.c +0
-0
drivers/nvme/target/fabrics-cmd.c static void nvmet_execute_io_connect(struct nvmet_req *req) · line 337
Quoted 7 lines
drivers/nvme/target/fabrics-cmd.c +0
-1@@ -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);
Cheers,
Hannes
Signature · 5 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +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
Re: [PATCH 2/2] nvme-auth: remove the redundant req->cqe->result.u16 assignment operation
In reply to Jackie LiuQuoted 6 lines · Jackie Liu
From: Jackie Liu <[email protected]>
req->cqe->result.u16has already been assigned in the previous line, no need to do it again.Signed-off-by Jackie Liu <[email protected]>
Looks good.
-ck
Re: [PATCH 2/2] nvme-auth: remove the redundant req->cqe->result.u16 assignment operation
In reply to Jackie LiuQuoted 18 lines · Jackie Liu
From: Jackie Liu <[email protected]>
Jump directly to
done_kfreeto release d, which is consistent with the code style behind.Reported-by Genjian Zhang <[email protected]>Signed-off-by Jackie Liu <[email protected]>--- drivers/nvme/target/fabrics-cmd-auth.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/nvme/target/fabrics-cmd-auth.c +0
-0@@ -229,10 +229,8 @@ void nvmet_execute_auth_send(struct nvmet_req *req) }
drivers/nvme/target/fabrics-cmd-auth.c void nvmet_execute_auth_send(struct nvmet_req *req) · line 236
Quoted 10 lines
drivers/nvme/target/fabrics-cmd-auth.c +2
-4status =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__,
Cheers,
Hannes
Signature · 5 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +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
Quoted 7 lines · Jackie Liu
From: Jackie Liu <[email protected]>
Jump directly to
done_kfreeto release d, which is consistent with the code style behind.Reported-by Genjian Zhang <[email protected]>Signed-off-by Jackie Liu <[email protected]>
done_kfree label already has a kfree call.
Looks good.
-ck
Thanks,
applied both to nvme-6.1.