linux/drivers/nvme/host
Ming Lei 03e0f3a65e nvme-pci: avoid dereference of symbol from unloaded module
The 'remove_work' may be scheduled to run after nvme_remove()
returns since we can't simply cancel it in nvme_remove() for
avoiding deadlock. Once nvme_remove() returns, this module(nvme)
can be unloaded.

On the other hand, nvme_put_ctrl() calls ctr->ops->free_ctrl
which may point to nvme_pci_free_ctrl() in unloaded module.

This patch avoids this issue by queuing 'remove_work' via 'nvme_wq',
and flush this worqueue in nvme_exit() as suggested by Sagi.

Suggested-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2017-11-10 19:53:25 -07:00
..
core.c nvme: send uevent for some asynchronous events 2017-11-10 19:53:25 -07:00
fabrics.c nvme: move controller deletion to common code 2017-11-01 16:28:04 +01:00
fabrics.h nvme: add helper to compare options to controller 2017-10-27 09:25:28 +03:00
fc.c nvme: remove handling of multiple AEN requests 2017-11-10 19:53:25 -07:00
Kconfig nvme: Remove SCSI translations 2017-06-28 08:14:13 -06:00
lightnvm.c lightnvm: implement generic path for sync I/O 2017-10-13 08:34:57 -06:00
Makefile nvme: Makefile: remove dead build rule 2017-06-29 09:43:23 -06:00
nvme.h nvme: send uevent for some asynchronous events 2017-11-10 19:53:25 -07:00
pci.c nvme-pci: avoid dereference of symbol from unloaded module 2017-11-10 19:53:25 -07:00
rdma.c nvme: remove handling of multiple AEN requests 2017-11-10 19:53:25 -07:00