[PATCH 4/6] nvme-auth: remove redundant buffer deallocations
Chaitanya Kulkarni
chaitanyak at nvidia.com
Tue Oct 25 10:36:56 PDT 2022
On 10/25/2022 6:43 AM, Sagi Grimberg wrote:
> host_response, host_key, ctrl_key and sess_key are
> freed in nvme_auth_reset_dhchap which is called from
> nvme_auth_free_dhchap.
>
Perhaps :-
host_response, host_key, ctrl_key and sess_key are freed in
nvme_auth_reset_dhchap which is called from nvme_auth_free_dhchap.
> Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
> ---
> drivers/nvme/host/auth.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/nvme/host/auth.c b/drivers/nvme/host/auth.c
> index 93c0fc71bc7c..15cddc2bb14d 100644
> --- a/drivers/nvme/host/auth.c
> +++ b/drivers/nvme/host/auth.c
> @@ -683,10 +683,6 @@ static void nvme_auth_free_dhchap(struct nvme_dhchap_queue_context *chap)
> crypto_free_shash(chap->shash_tfm);
> if (chap->dh_tfm)
> crypto_free_kpp(chap->dh_tfm);
> - kfree_sensitive(chap->ctrl_key);
> - kfree_sensitive(chap->host_key);
> - kfree_sensitive(chap->sess_key);
> - kfree_sensitive(chap->host_response);
> kfree(chap->buf);
> kfree(chap);
> }
Reviewed-by: Chaitanya Kulkarni <kch at nvidia.com>
-ck
More information about the Linux-nvme
mailing list