]>
Commit | Line | Data |
---|---|---|
2289b8c5 SL |
1 | From 44482a7804dd9efd6ecc64b2ed3ad3f8523218d1 Mon Sep 17 00:00:00 2001 |
2 | From: Yufen Yu <yuyufen@huawei.com> | |
3 | Date: Thu, 16 May 2019 19:30:07 -0700 | |
4 | Subject: nvme: fix memory leak for power latency tolerance | |
5 | ||
6 | [ Upstream commit 510a405d945bc985abc513fafe45890cac34fafa ] | |
7 | ||
8 | Unconditionally hide device pm latency tolerance when uninitializing | |
9 | the controller to ensure all qos resources are released so that we're | |
10 | not leaking this memory. This is safe to call if none were allocated in | |
11 | the first place, or were previously freed. | |
12 | ||
13 | Fixes: c5552fde102fc("nvme: Enable autonomous power state transitions") | |
14 | Suggested-by: Keith Busch <keith.busch@intel.com> | |
15 | Tested-by: David Milburn <dmilburn@redhat.com> | |
16 | Signed-off-by: Yufen Yu <yuyufen@huawei.com> | |
17 | [changelog] | |
18 | Signed-off-by: Keith Busch <keith.busch@intel.com> | |
19 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
20 | --- | |
21 | drivers/nvme/host/core.c | 1 + | |
22 | 1 file changed, 1 insertion(+) | |
23 | ||
24 | diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c | |
25 | index 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 | -- | |
37 | 2.20.1 | |
38 |