]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-rdma: fix possible double free condition when failing to create a controller
authorSagi Grimberg <sagi@grimberg.me>
Tue, 19 Jun 2018 12:34:09 +0000 (15:34 +0300)
committerChristoph Hellwig <hch@lst.de>
Wed, 20 Jun 2018 12:20:10 +0000 (14:20 +0200)
commit9600567686e04abe5a239329c7ee623ee0df852c
tree5ed6d9e3ded85d03728943f2ab4b10269e3493e0
parent85cbf5bd415ad61270700c0ae7efd376d5a3375b
nvme-rdma: fix possible double free condition when failing to create a controller

Failures after nvme_init_ctrl will defer resource cleanups to .free_ctrl
when the reference is released, hence we should not free the controller
queues for these failures.

Fix that by moving controller queues allocation before controller
initialization and correctly freeing them for failures before
initialization and skip them for failures after initialization.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/rdma.c