[PATCH 1/2] nvmet-auth: clean up with done_kfree

Hannes Reinecke hare at suse.de
Thu Aug 11 23:01:57 PDT 2022


On 8/12/22 05:12, Jackie Liu wrote:
> From: Jackie Liu <liuyun01 at kylinos.cn>
> 
> Jump directly to done_kfree to release d, which is consistent with the
> code style behind.
> 
> Reported-by: Genjian Zhang <zhanggenjian at kylinos.cn>
> Signed-off-by: Jackie Liu <liuyun01 at 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 at suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare at 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



More information about the Linux-nvme mailing list