blktests nvme 041,042 leak memory
Maurizio Lombardi
mlombard at redhat.com
Mon Jun 3 02:38:39 PDT 2024
po 3. 6. 2024 v 11:33 odesílatel Hannes Reinecke <hare at suse.de> napsal:
> Like this?
>
> diff --git a/drivers/nvme/host/auth.c b/drivers/nvme/host/auth.c
> index a264b3ae078b..668cc4d891d7 100644
> --- a/drivers/nvme/host/auth.c
> +++ b/drivers/nvme/host/auth.c
> @@ -983,7 +983,8 @@ EXPORT_SYMBOL_GPL(nvme_auth_init_ctrl);
>
> void nvme_auth_stop(struct nvme_ctrl *ctrl)
> {
> - cancel_work_sync(&ctrl->dhchap_auth_work);
> + if (ctrl->dhchap_ctxs)
> + cancel_work_sync(&ctrl->dhchap_auth_work);
> }
> EXPORT_SYMBOL_GPL(nvme_auth_stop);
>
Yes, I was not sure if it was safe to use dhchap_ctxs because
nvme_auth_init_ctrl() could return
success while leaving a NULL dhchap_ctxs pointer.
Maurizio
More information about the Linux-nvme
mailing list