]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.19.53/nvme-fix-memory-leak-for-power-latency-tolerance.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.19.53 / nvme-fix-memory-leak-for-power-latency-tolerance.patch
CommitLineData
2289b8c5
SL
1From 44482a7804dd9efd6ecc64b2ed3ad3f8523218d1 Mon Sep 17 00:00:00 2001
2From: Yufen Yu <yuyufen@huawei.com>
3Date: Thu, 16 May 2019 19:30:07 -0700
4Subject: nvme: fix memory leak for power latency tolerance
5
6[ Upstream commit 510a405d945bc985abc513fafe45890cac34fafa ]
7
8Unconditionally hide device pm latency tolerance when uninitializing
9the controller to ensure all qos resources are released so that we're
10not leaking this memory. This is safe to call if none were allocated in
11the first place, or were previously freed.
12
13Fixes: c5552fde102fc("nvme: Enable autonomous power state transitions")
14Suggested-by: Keith Busch <keith.busch@intel.com>
15Tested-by: David Milburn <dmilburn@redhat.com>
16Signed-off-by: Yufen Yu <yuyufen@huawei.com>
17[changelog]
18Signed-off-by: Keith Busch <keith.busch@intel.com>
19Signed-off-by: Sasha Levin <sashal@kernel.org>
20---
21 drivers/nvme/host/core.c | 1 +
22 1 file changed, 1 insertion(+)
23
24diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
25index 818788275406..a867a139bb35 100644
26--- a/drivers/nvme/host/core.c
27+++ b/drivers/nvme/host/core.c
28@@ -3525,6 +3525,7 @@ EXPORT_SYMBOL_GPL(nvme_start_ctrl);
29
30 void nvme_uninit_ctrl(struct nvme_ctrl *ctrl)
31 {
32+ dev_pm_qos_hide_latency_tolerance(ctrl->device);
33 cdev_device_del(&ctrl->cdev, ctrl->device);
34 }
35 EXPORT_SYMBOL_GPL(nvme_uninit_ctrl);
36--
372.20.1
38