nvmet-auth: clean up with done_kfree
authorJackie Liu <liuyun01@kylinos.cn>
Fri, 12 Aug 2022 03:12:30 +0000 (11:12 +0800)
committerChristoph Hellwig <hch@lst.de>
Mon, 19 Sep 2022 09:33:54 +0000 (11:33 +0200)
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>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/fabrics-cmd-auth.c

index ebdf9aa..8458ec4 100644 (file)
@@ -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__,