]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-rdma: fix possible free of a non-allocated async event buffer
authorSagi Grimberg <sagi@grimberg.me>
Tue, 19 Jun 2018 12:34:10 +0000 (15:34 +0300)
committerChristoph Hellwig <hch@lst.de>
Wed, 20 Jun 2018 12:20:28 +0000 (14:20 +0200)
commit827e25ca4e397700e3642f565fb34b235ed40b21
tree9e9f01f9576663e64878e24ee25373ee7f712dac
parent50e50719f556c7d55dbe20be9a8836db1af83987
nvme-rdma: fix possible free of a non-allocated async event buffer

If nvme_rdma_configure_admin_queue fails before we allocated
the async event buffer, we will falsly free it because
nvme_rdma_free_queue is freeing it. Fix it by allocating the buffer right
after nvme_rdma_alloc_queue and free it right before nvme_rdma_queue_free
to maintain orderly reverse cleanup sequence.

Reported-by: Israel Rukshin <israelr@mellanox.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/rdma.c