Skip to content

Commit 510a405

Browse files
Yufen YuKeith Busch
authored andcommitted
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: c5552fd("nvme: Enable autonomous power state transitions") Suggested-by: Keith Busch <[email protected]> Tested-by: David Milburn <[email protected]> Signed-off-by: Yufen Yu <[email protected]> [changelog] Signed-off-by: Keith Busch <[email protected]>
1 parent 5fb4aac commit 510a405

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/nvme/host/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3700,6 +3700,7 @@ EXPORT_SYMBOL_GPL(nvme_start_ctrl);
37003700

37013701
void nvme_uninit_ctrl(struct nvme_ctrl *ctrl)
37023702
{
3703+
dev_pm_qos_hide_latency_tolerance(ctrl->device);
37033704
cdev_device_del(&ctrl->cdev, ctrl->device);
37043705
}
37053706
EXPORT_SYMBOL_GPL(nvme_uninit_ctrl);

0 commit comments

Comments
 (0)