blktests nvme 041,042 leak memory
Hannes Reinecke
hare at suse.de
Mon Jun 3 02:33:37 PDT 2024
On 6/3/24 10:52, Maurizio Lombardi wrote:
> po 3. 6. 2024 v 10:37 odesílatel Hannes Reinecke <hare at suse.de> napsal:
>>
>> On 5/31/24 16:37, Maurizio Lombardi wrote:
>> Hmm. Don't really like it.
>> We took great pains of moving then entire DH-CHAP code into its own
>> file, and this patch reverts it and is causing the DH-CHAP code to be
>> littered all over the place.
>
> This was just an example, I'm not asking to merge it.
>
> I just had to find a way to make it possible to call nvme_auth_stop() even
> when nvme_auth_init() has never been called without crashing the kernel,
> moving INIT_WORK was the easiest way.
>
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);
Cheers,
Hannes
More information about the Linux-nvme
mailing list