linux/drivers/nvme/host
Chaitanya Kulkarni 2ed9a89192 nvme-core: fix dev_pm_qos memleak
[ Upstream commit 7ed5cf8e6d ]

Call dev_pm_qos_hide_latency_tolerance() in the error unwind patch to
avoid following kmemleak:-

blktests (master) # kmemleak-clear; ./check nvme/044;
blktests (master) # kmemleak-scan ; kmemleak-show
nvme/044 (Test bi-directional authentication)                [passed]
    runtime  2.111s  ...  2.124s
unreferenced object 0xffff888110c46240 (size 96):
  comm "nvme", pid 33461, jiffies 4345365353 (age 75.586s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<0000000069ac2cec>] kmalloc_trace+0x25/0x90
    [<000000006acc66d5>] dev_pm_qos_update_user_latency_tolerance+0x6f/0x100
    [<00000000cc376ea7>] nvme_init_ctrl+0x38e/0x410 [nvme_core]
    [<000000007df61b4b>] 0xffffffffc05e88b3
    [<00000000d152b985>] 0xffffffffc05744cb
    [<00000000f04a4041>] vfs_write+0xc5/0x3c0
    [<00000000f9491baf>] ksys_write+0x5f/0xe0
    [<000000001c46513d>] do_syscall_64+0x3b/0x90
    [<00000000ecf348fe>] entry_SYSCALL_64_after_hwframe+0x72/0xdc

Link: https://lore.kernel.org/linux-nvme/CAHj4cs-nDaKzMx2txO4dbE+Mz9ePwLtU0e3egz+StmzOUgWUrA@mail.gmail.com/
Fixes: f50fff73d6 ("nvme: implement In-Band authentication")
Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
Tested-by: Yi Zhang <yi.zhang@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2023-07-19 16:35:09 +02:00
..
apple.c nvme-apple: return directly instead of else 2023-04-13 08:55:06 +02:00
auth.c block-6.3-2023-03-03 2023-03-03 10:21:39 -08:00
constants.c nvme: fix the name of Zone Append for verbose logging 2023-05-31 09:21:26 -07:00
core.c nvme-core: fix dev_pm_qos memleak 2023-07-19 16:35:09 +02:00
fabrics.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
fabrics.h nvme-fabrics: show well known discovery name 2023-02-28 06:14:44 -07:00
fault_inject.c block: remove the ->rq_disk field in struct request 2021-11-29 06:41:29 -07:00
fc.c drivers: remove struct module * setting from struct class 2023-03-17 15:16:27 +01:00
fc.h nvme-fc: Update header and host for common definitions for LS handling 2020-05-09 16:18:33 -06:00
hwmon.c nvme-pci: add quirk for missing secondary temperature thresholds 2023-05-03 18:11:43 +02:00
ioctl.c nvme: fix miss command type check 2023-05-30 08:50:24 -07:00
Kconfig nvme-auth: Diffie-Hellman key exchange support 2022-08-02 17:14:49 -06:00
Makefile nvme: don't always build constants.o 2022-08-02 17:22:48 -06:00
multipath.c Merge tag 'nvme-6.4-2023-05-18' of git://git.infradead.org/nvme into block-6.4 2023-05-18 19:46:42 -06:00
nvme.h nvme: check IO start time when deciding to defer KA 2023-05-30 09:20:47 -07:00
pci.c NVMe: Add MAXIO 1602 to bogus nid list. 2023-05-26 08:21:50 -07:00
rdma.c blk-mq-rdma: remove queue mapping helper for rdma devices 2023-04-13 08:59:05 +02:00
tcp.c for-6.4/block-2023-04-21 2023-04-26 12:52:58 -07:00
trace.c nvme: implement In-Band authentication 2022-08-02 17:14:49 -06:00
trace.h nvme: fix async event trace event 2023-04-13 08:59:04 +02:00
zns.c block: pass a gendisk to blk_queue_max_open_zones and blk_queue_max_active_zones 2022-07-06 06:46:26 -06:00