]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nvme/pci: Don't free queues on error
authorKeith Busch <keith.busch@intel.com>
Tue, 15 Nov 2016 20:56:26 +0000 (15:56 -0500)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 23 Feb 2017 03:54:35 +0000 (03:54 +0000)
commit4f5af796101b0b79b3535a9b94bce7d3979dfd82
tree07b7df39e9421a9137722c411f5290a7bcd761c3
parent220d91f75b48f16d28541b87fef790b45cbc516d
nvme/pci: Don't free queues on error

commit d48756228ee9161ac8836b346589a43fabdc9f3c upstream.

The nvme_remove function tears down all allocated resources in the correct
order, so no need to free queues on error during initialization. This
fixes possible use-after-free errors when queues are still associated
with a blk-mq hctx.

Reported-by: Scott Bauer <scott.bauer@intel.com>
Tested-by: Scott Bauer <scott.bauer@intel.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimbeg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
[bwh: Backported to 3.16:
 - Adjust filename, context
 - Only nvme_setup_io_queues() needs to be fixed]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/block/nvme-core.c