]> 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)
commit50e50719f556c7d55dbe20be9a8836db1af83987
tree5ed6d9e3ded85d03728943f2ab4b10269e3493e0
parent878b1eaf11b357d64fa82acc105cf6cbdd39b0a8
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