[PATCH 1/2] nvme-multipath: fix leak on try_module_get failure
John Garry
john.g.garry at oracle.com
Wed Apr 15 08:13:14 PDT 2026
On 15/04/2026 15:23, Keith Busch wrote:
>> @@ -4083,7 +4083,8 @@ static int nvme_init_ns_head(struct nvme_ns *ns,
>> struct nvme_ns_info *info)
>> mutex_unlock(&ctrl->subsys->lock);
>>
>> #ifdef CONFIG_NVME_MULTIPATH
>> - cancel_delayed_work(&head->remove_work);
>> + if (cancel_delayed_work_sync(&head->remove_work))
>> + module_put(THIS_MODULE);
>> #endif
> I don't think we need the _sync() variant here, but the check and
> module_put() look good.
Yeah, I don't think that the _sync is required either.
cheers
More information about the Linux-nvme
mailing list