diff options
author | Israel Rukshin <israelr@mellanox.com> | 2017-11-13 12:29:41 +0000 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-01-08 11:01:59 +0100 |
commit | 6b1943af3f4329c814ec7a651121746d08e6c9ee (patch) | |
tree | d027ba51b04dce8b4a1520f281b611c087cc5f18 /drivers/nvme/target | |
parent | eca19dc1d84d924544dda0c8d2fd4bb4131affeb (diff) | |
download | talos-obmc-linux-6b1943af3f4329c814ec7a651121746d08e6c9ee.tar.gz talos-obmc-linux-6b1943af3f4329c814ec7a651121746d08e6c9ee.zip |
nvmet: rearrange nvmet_ctrl_free()
Make it symmetric to nvmet_alloc_ctrl().
Signed-off-by: Israel Rukshin <israelr@mellanox.com>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/target')
-rw-r--r-- | drivers/nvme/target/core.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c index 07eb45d32a7a..7282ea8d3b96 100644 --- a/drivers/nvme/target/core.c +++ b/drivers/nvme/target/core.c @@ -879,21 +879,22 @@ static void nvmet_ctrl_free(struct kref *ref) struct nvmet_ctrl *ctrl = container_of(ref, struct nvmet_ctrl, ref); struct nvmet_subsys *subsys = ctrl->subsys; - nvmet_stop_keep_alive_timer(ctrl); - mutex_lock(&subsys->lock); list_del(&ctrl->subsys_entry); mutex_unlock(&subsys->lock); + nvmet_stop_keep_alive_timer(ctrl); + flush_work(&ctrl->async_event_work); cancel_work_sync(&ctrl->fatal_err_work); ida_simple_remove(&cntlid_ida, ctrl->cntlid); - nvmet_subsys_put(subsys); kfree(ctrl->sqs); kfree(ctrl->cqs); kfree(ctrl); + + nvmet_subsys_put(subsys); } void nvmet_ctrl_put(struct nvmet_ctrl *ctrl) |