nvme: fix memory leak for power latency tolerance

Unconditionally hide device pm latency tolerance when uninitializing
the controller to ensure all qos resources are released so that we're
not leaking this memory. This is safe to call if none were allocated in
the first place, or were previously freed.

Fixes: c5552fde102fc("nvme: Enable autonomous power state transitions")
Suggested-by: Keith Busch <keith.busch@intel.com>
Tested-by: David Milburn <dmilburn@redhat.com>
Signed-off-by: Yufen Yu <yuyufen@huawei.com>
[changelog]
Signed-off-by: Keith Busch <keith.busch@intel.com>

authored by

Yufen Yu and committed by
Keith Busch
510a405d 5fb4aac7

+1
+1
drivers/nvme/host/core.c
··· 3700 3700 3701 3701 void nvme_uninit_ctrl(struct nvme_ctrl *ctrl) 3702 3702 { 3703 + dev_pm_qos_hide_latency_tolerance(ctrl->device); 3703 3704 cdev_device_del(&ctrl->cdev, ctrl->device); 3704 3705 } 3705 3706 EXPORT_SYMBOL_GPL(nvme_uninit_ctrl);