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

nvme-loop: fix module_init (theoretical) error path

if nvmf_register_transport happend to fail, we
need to nvmet_unregister_transport as well.
Signed-off-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent a56c79cf
......@@ -745,7 +745,12 @@ static int __init nvme_loop_init_module(void)
ret = nvmet_register_transport(&nvme_loop_ops);
if (ret)
return ret;
return nvmf_register_transport(&nvme_loop_transport);
ret = nvmf_register_transport(&nvme_loop_transport);
if (ret)
nvmet_unregister_transport(&nvme_loop_ops);
return ret;
}
static void __exit nvme_loop_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