]> www.infradead.org Git - users/jedix/linux-maple.git/commit
NVMe: Fix memory leak on retried commands
authorKeith Busch <keith.busch@intel.com>
Thu, 15 Oct 2015 19:38:48 +0000 (13:38 -0600)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 5 Feb 2016 03:28:30 +0000 (19:28 -0800)
commit33eb8012e4d61a4b478e8b923028494d28832478
treeab99afaf68ec6631fcdd5baac1245555d1fdd4bf
parent0bba0b7bd50d0e1d46c5eec25ace72711df4dc01
NVMe: Fix memory leak on retried commands

Orabug: 22623828

commit 0dfc70c33409afc232ef0b9ec210535dfbf9bc61 upstream.

Resources are reallocated for requeued commands, so unmap and release
the iod for the failed command.

It's a pretty bad memory leak and causes a kernel hang if you remove a
drive because of a busy dma pool. You'll get messages spewing like this:

  nvme 0000:xx:xx.x: dma_pool_destroy prp list 256, ffff880420dec000 busy

and lock up pci and the driver since removal never completes while
holding a lock.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit a1638a11d9fb9457a8a5a9cc1a00e59ca56c8fe3)
Signed-off-by: Dan Duval <dan.duval@oracle.com>
drivers/block/nvme-core.c