summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYufen Yu <yuyufen@huawei.com>2019-05-17 05:30:07 +0300
committerKeith Busch <keith.busch@intel.com>2019-05-17 20:08:09 +0300
commit510a405d945bc985abc513fafe45890cac34fafa (patch)
tree9bfbd1bf8a1ef26b8a13a5c802b0eef668aa3241
parent5fb4aac756acacf260b9ebd88747251effa3a2f2 (diff)
downloadlinux-510a405d945bc985abc513fafe45890cac34fafa.tar.xz
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>
-rw-r--r--drivers/nvme/host/core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index d4226c18eb71..e1449c196f20 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3700,6 +3700,7 @@ EXPORT_SYMBOL_GPL(nvme_start_ctrl);
void nvme_uninit_ctrl(struct nvme_ctrl *ctrl)
{
+ dev_pm_qos_hide_latency_tolerance(ctrl->device);
cdev_device_del(&ctrl->cdev, ctrl->device);
}
EXPORT_SYMBOL_GPL(nvme_uninit_ctrl);