Commit a56c79cf authored by Sagi Grimberg's avatar Sagi Grimberg Committed by Jens Axboe

nvme-rdma: fix module_init (theoretical) error path

If nvmf_register_transport happened to fail
(it can't, but theoretically) we leak memory.
Signed-off-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 2ca0786d
......@@ -2030,12 +2030,20 @@ static int __init nvme_rdma_init_module(void)
return -ENOMEM;
ret = ib_register_client(&nvme_rdma_ib_client);
if (ret) {
destroy_workqueue(nvme_rdma_wq);
return ret;
}
if (ret)
goto err_destroy_wq;
ret = nvmf_register_transport(&nvme_rdma_transport);
if (ret)
goto err_unreg_client;
return nvmf_register_transport(&nvme_rdma_transport);
return 0;
err_unreg_client:
ib_unregister_client(&nvme_rdma_ib_client);
err_destroy_wq:
destroy_workqueue(nvme_rdma_wq);
return ret;
}
static void __exit nvme_rdma_cleanup_module(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment